Student or Learner
Why do the first person and second person reflexive pronouns (myself/yourself) use the possessives my/your and all the others use the objectives her/him/it/them?
I [my] me myself
you [your] you yourself
she her [her] herself
he his [him] himself
it its [it] itself
they their [them] themselves
Is there an explanation or is it just a grammar rule?
No grammatical rule. Just the history of English. It's a process called paradigmatic regularization. For example, Old English (O.E.) meself became Middle English (M.E.) myself because other pronouns in that grammatical category had similar forms, like herself:
Online Etymology Dictionary
O.E., from phrase ic me self, where me is "a kind of ethical dative" [OED], altered in Middle Ages from meself on analogy of herself, with her- felt as gen.; though analogous hisself remains bad form.