It's a common phenomenon: a touch that normally feels a bit painful can feel much nicer when you're sexually aroused.
In an article at BBC Future, Zaria Gorvett examines how the brain's natural opiates can produce a shift between pain and pleasure inside our heads.
(the hippocampus)...responds to pain signals by ordering the production of the body's own narcotics, endorphins. The proteins bind to opioid receptors in the brain and prevent the release of chemicals involved in the transmission of pain signals. This helps block pain, but endorphins go further, stimulating the brain's limbic and prefrontal regions — the same areas activated by passionate love affairs and music. It's a post-pain rush similar to the high of morphine or heroin, which also bind to the brain's opioid receptors.
Given that the mammalian brain routes pain and sexual signals through many of the same regions: including the hypothalamus, which regulates both mood and sex drive, the amygdala, which manages emotions, and the periaqueductal grey, which regulates both pain and female sexual behaviours, it probably shouldn't surprise us that there's some cross-talk. Or that thrill-seeking humans take advantage of it.