Why is the comma inside quotation marks when people are quoted? [duplicate]

The question would be better off in the context of AmE. But in any case, in American Style it's a hard-and-fast rule to place commas and periods inside the quotation marks. In BrE, it depends on where the comma and period belong. If they belong to the quoted text, they are placed inside, otherwise they are placed outside.

To answer your question of "why," I think the rule was designed and posed by compositors in the early days and has been this way since then.

That said, the rule applies only to commas and periods not other punctuation marks like, question mark, etc.