The same mental illness can differ in the way it appears in different cultures. For instance, hallucinations might be equally common in schizophrenia in France and in India, but what the hallucinations are about is going to differ.
So cultures affect conditions which also have a biological basis. I think the same applies here, too, but even more widely:
It's not just social contagion which we should address, but also the unrealistic images popular culture creates about how women and girls should look, and how not achieving that perfection is used to bully girls, and certainly also how the enormous increases in clearly misogynistic porn and its consumption by ever younger boys affects growing up female today.
When you add all that to the upheavals caused by puberty, to the sudden interest even quite old men start taking in your body, to the increase in harassment etc. it's not really very surprising that many teen girls are depressed and sad and feel powerless.
Ways of regaining some power, and perhaps some (non-sexual) attention from their peers can include self-harming, not eating, refusing to become a woman etc. In other times and places different forms of resistance exist, but I see all of them as forms of protest.
If you have little control over how others see you and how they treat you, at least you can control your own body. That would be the shared part in these responses; how that control happens varies and is culture-specific, though the Internet is probably now erasing many of those cultural differences.
There are some commonalities between the various coping mechanisms, but they are not the same. Likewise, there may be other motivations for taking the types of actions this thread discusses.
But gender dysphoria, body dysmorphia, and anorexia all seem to share something atypical happening in that part of the brain which is responsible for self-perception (e.g. what we see in the mirror as opposed to what the mirror objectively shows).
In that way they are in the same wider family of conditions. (I only know personally about anorexia, having had it, but I did have one of those sudden views of myself I had not mentally prepared for (in a shop window) which somehow showed me the real me (frighteningly thin), even though my mirror did not. So I certainly had warped self-perception until that point in time.)