For your title question:
When you get a nightmare could the message in it be right?
The short answer is no.
I'm not very clear about your elaboration in explaining the title.
What dream is, is that the fragments of concepts and experiences left in the memory re-associated themselves without immediate sensual organs' input, during sleep. Dharma Master Xuanzang (玄奘法師 602–664CE) has very profound explanation on how this happened with his neat Karika on the Eight Consciousness of Yogacara teaching.
In short, dream or nightmare is your mind's contriving and unreal. Yet, due to dream happened without the sensual input's limitation and censorship, therefore, it's not confined in spatial-temporal. In this sense, it could have fore-telling function, or reveal the true meaning of past experiences. It's very rare though, required quite a purified mind.
On the other hand, other dimension of beings could penetrate into a mind in dream which dwelt in the same dimension, therefore, what your "demons" could be this type of thing. However, it's only your mind allowed it's manifestation. But in dream your mind, normal people, is helpless in controlling it. Thus, you will be frightened, they seemed able to harm you, etc. This could happen in meditative stage, for the same reason; for you are accessing your mind, disconnecting from your body. The inside is the outside, the outside the inside. But it's even more rare, very very few people could really do meditation this day, except gleaning a little bit of relief and comfort by sitting without thinking, or doing nothing, compared to the hectic daily life. The teaching of meditation is lost.