People who are athletic will generally tell you that the "burn" they feel when they exercise/build muscle is a good feeling.
From the wikipedia page on endorphins:
They are produced by the pituitary gland and the hypothalamus in vertebrates during exercise, excitement, pain, consumption of spicy food, love and orgasm, and they resemble the opiates in their abilities to produce analgesia and a feeling of well-being.
It's also oft been speculated
that the reason some people are masochists is due to overactive endorphin production in response to pain.
It's also been found that bottoms in BDSM have higher testosterone than tops
Based on this, I would say it's not a far stretch to claim that masochism is due to testosterone and endorphin production being in overdrive.
It's well-known that endorphins are released when a person exercises, and testosterone also contributes to building muscle, so both are also active when a person exercises. My theory is that the reason that the "burn" feeling of exercising is a good feeling to athletes is that the hormones involved turn our bodies mildly masochistic when we exercise.
"All pain is a punishment, and every punishment is inflicted for love as much as for justice." — Joseph De Maistre.