Dreams are an examination of your unconscious. Dreams often happen and vividly depict the parts of our brains that deal with the unconsciousness and things that we may not be aware of. I believe Carl Jung's is right in saying that dreams are part of the unconscious and that they are very part of what makes up our individual personality.
There are many theories about dreams that probably have some validity to them and there are likely aspects of them that are more or less random, but there absolutely has to be some researching ones own unconscious within there. While the events that take place in dreams often surprise us the venues and characters involved do not, that comes from things stored deep internally.
When we are asleep, our unconscious mind is freed to make connections that our conscious mind may fear. We are able to experience anger, frustration, and other negative emotions without consequence. Our unconscious mind can create a safe space where we can examine these emotions and even act on them, learn from them, all without worrying that anything bad will happen since none of it is real. We can wake up with a better understanding of what we're feeling, why we're feeling it, and what we can about it to alleviate feelings that we don't want to have.
I believe it is possible that Carl Jung's theory that dreams are an examination of a person's subconscious. There's not proof that is theory in invalid and in my experience I see how it could be a possibility in some dreams, but maybe not all of them. Given that some medications can influence dreams I don't believe it's 100% true.
Although Carl Jung's theories are well known in academia, there is no scientific proof that they are correct. It is not possible to formulate a scientific experiment that would prove or disprove whether his theories are correct. Until one can be made, his theories will remain a form of literature rather than science.