Sensory inputs that are interpreted as pain can also be reinterpreted. Ever use nitrous for dental work? The stuff doesn't shut down the nerve impulses, it makes the brain find them amusing instead of distressing.

I've had several massages (and also just plain mental exercises, but massage works better) where nerve signals that caused suffering started delivering information instead. Same impulses, different interpretation. It works - sometimes.

Ever had a fall, where the immediate feeling is F*CK THAT HURTS and then you wonder what exactly got hit, what the damage is, focus on the precise nature of the pain sensation, and find it both informative and far easier to cope with? That's the kind of thing I'm talking about. A good massage can be good for that.