This is not correct. The souls of certain people are allowed to leave their graves. One example is the prophets. So it is possible when you see someone in a dream, that you have met their soul, but it is also possible that the dream may simply be a creation of your mind.