Absolutely, Dewey. I sometimes compose symphonies in my sleep. I promptly forget them upon awakening, but there is usually a lingering feeling of something special for a while after I wake up.
Funny thing is that I can't even hear music in my head when I'm awake. But sleeping seems to be a different story.