If one takes the entire Qur'an to be the truth, then we cannot rule out the possibility of some dreams being prophetic, as in the case of Prophet Yusuf/Joseph. However, I would not say that all dreams come true. I've had some dreams that were seemingly meaningless, like some dreams I've had of doing the same things I do daily and that were not out of the ordinary. Some were entertaining and fantastical, like childhood dreams about flying on the back of a unicorn (lol). I've had some dreams, however, that seemed to be warnings. I do not like to talk about them, as they were frightening and for some reason, I feel that I should never speak of them (superstition?).
Regardless, according to the Qur'an, our souls are taken when we are asleep.
"Allah takes the souls at the time of their death, and those that do not die [He takes] during their sleep. Then He keeps those for which He has decreed death and releases the others for a specified term. Indeed in that are signs for a people who give thought." [39:42]
While our souls are in an unknown place, it may be possible that our dreams may also be affected by God or at times by the Unseen/the place that our soul is at that time.
Regardless, according to the Qur'an, our souls are taken when we are asleep.
"Allah takes the souls at the time of their death, and those that do not die [He takes] during their sleep. Then He keeps those for which He has decreed death and releases the others for a specified term. Indeed in that are signs for a people who give thought." [39:42]
While our souls are in an unknown place, it may be possible that our dreams may also be affected by God or at times by the Unseen/the place that our soul is at that time.