Yes, that sounds understandable to me, given a few different bits of your situation.
Co-codamol is an opiate and therefore has strong hypnagogic qualities, ie. it'll make you sleep less heavily which lowers your threshold for vivid dreams.
Without knowing your situation I can't speculate, but it's possible that your shoulder pain has an emotional aspect. Lots of fibromyalgic pain does, in my experience, and is also nervous system-related. Between your nerves and your (possibly repressed and unprocessed) feelings, there might be emotional pain coming up through your dreams related to past difficulties. This is one of the functions of dreams, which is why you feel the painful emotions linked to the horrible dream. Your psyche, or body-mind, could be using an opportunity when you're less conscious (and less defended psychologically, ie. asleep) to work through those unresolved feelings from the past. However bizarre the manifest content of your dreams is at the moment, the latent feelings beneath are old and have been pushed down until now.
Sounds like your psyche is processing difficult stuff. Not comfortable, but purging in a healthy way, ultimately. The relaxation that the codeine is providing helps that happen. If you've had enough and are struggling to cope with the dreams though, you might want to take just paracetamol or aspirin instead, especially before going to bed.