You do understand that you need to ask these questions of a psychologist?
That said, as a layman, it seems to me that since dreams only exist in the brain, they reflect the current state of the brain. I don't see any reason why the couldn't also change the state of the brain.
I gather that these nightmares are something you would like to avoid -- I have to ask, because most of my own dreams are pleasant -- the closest I've come to a nightmare is when I dreamed somebody I loved had died, and even then the strongest memory of the dream was how releaved I was when I woke up and realized it was only a dream.
You asked earlier if you needed talk therapy as well as meds. I would guess the nightmares are a sign that you need both.