Pegging is a sexual practice in which a person identifying as a woman performs anal sex on a person identifying as a man by penetrating the man's anus with a strap-on dildo. This practice may also involve stimulating the male genitalia.
Often pegging is wound-up in constructions of gender and sexuality as it specifically means a woman identified person penetrating a male identified person. Those who are men having sex with men are simply having sex and trans, gender-queer/fluid and two-spirit folks may experience this sexual act much differently or the same depending on their own identities and sexualities.
Ultimately, the term pegging is largely considered to mean a straight man being penetrated by a woman. However, all terms and language is subject to change over time and in different places by different people.