The science of dreams is wibbly-wobbly as it is - which much of psychology our attempts to explain the outcomes of our brains is in advance of the ability of neurology. In doing so we get ahead of ourselves. Also, even by the relatively meager standards of the field I am no expert.
But the experience of pain is nothing more than a quale. Qualia are what we experience, distinct as a term from the physiological processes. For the time being they remain the greatest mystery of biology - we cannot explain what makes the experience yet, though no doubt the answer is in the brain.
I see no reason why there cannot be a pain version of a hallucination. I haven't actually heard of pain being felt in a dream, at least not that is recalled, but again I don't know why or that it absolutely cannot happen.
But memory is also a funny and almost useless thing, more so with dreams. Many of our memories are entirely fabricated. It could quite easily be the case that you did not actually experience pain at all, but now remember that you did.
__________________
| (• ◡•)| (❍ᴥ❍ʋ)
|