We tend to speak in generalized terms of dreams happening in the unconscious (or subconscious) mind, or how it happens mostly in the right (intuitive) brain and that the left (logical) brain goes ‘offline’ during sleep (with exceptions such as lucid dreaming). While these generalizations may apply, it is much more complicated than that. There are many parts of the brain involved during REM dreaming and the different stages of sleep.
If you have ever been curious about what parts of the brain are active during dreaming, here is an amazingly comprehensive article written by Bob Hoss:
http://dreamscience.org/idx_science_of_dreaming_section-3.htm
GREAT research and explanation. Thanks, Bob!