It is routine for some dreams to feel like they originate outside the mind of the dreamer.
The effect is easily achieved. Any complicated thought that arises "fully formed" is apt to make the thinker wonder "I thought that?"
So far as the thinker can tell, the answer would be No.
Awake or asleep makes little difference to the process, only to the words used to describe the phenomenon. A fully formed thought that presents while
we are awake is often called an epiphany or an inspiration. Both words implicitly suggest an outside source, as if a "message" has been sent to the
thinker.
It would be productive to work on the content of your nightmares. But their source is you.



