The original (2001) definition of pegging was very gendered: a woman putting on a strap-on and penetrating a man anally. Since then the gender binary has evolved and so has the definition.
There are parts of the queer community that have embraced the word to mean anyone putting on a strap-on and penetrating anyone in any orifice. Some people use the term interchangeably for anal sex. There are even some who dislike the word pegging and feel that the need for a word to differentiate it from other anal sex had homophobic origins.
My personal definition is anyone wearing a strap-on and penetrating a prostate owner anally.
Having said that, there are people who identify as male who do not have a prostate, people who identify as female who do have a prostate, and people who identify as non-binary who may or may not have a prostate.
I teach to prostate owners as receivers and vagina owners as givers. Gender identification and sexual orientation is unimportant when taking my classes and perusing my pegging information.