I would go so far as to say that it is not just the man's "dream" that is important, but all of his dreams. In fact, dreams end up becoming a theme in this important novel. In short, the man's dreams always have to do with danger: past or present.
The man's dreams often accompany a feeling of foreboding because the danger within them isn't specific. They often involve some imaginary creatures, such as the creature in the cave noted when the story begins. Although that particular dream is in the present, the man's flashbacks can indicate his dreams from the past. In this case, the danger can be found in the future. Why? Because during the flashbacks, the man's wife is still living and the earth is still fruitful.
The importance of these dreams is explained directly to the boy from the man:
When your dreams are of some world that never was or of some world that never will be and you are happy again then you will have given up.
This means something very specific and direct: bad dreams are very important. They mean that you have not given up on life in the world. It is the happy dream that is to be feared because it means you need to dream in order to escape in to a world of make-believe.
Dreams are an important motif in the novel. The man dreams of nameless, vague danger, or mythological danger like the cave creature in the beginning of the story. He also has flashbacks to when his wife was alive, and the times before the world went barren.
The man explains to the boy that bad dreams are a good thing. They mean you are still fighting, and you haven’t given up.
When your dreams are of some world that never was or of some world that never will be and you are happy again then you will have given up. (p. 189)
The man distrusts good dreams, and “the right dreams for a man in peril were dreams of peril” (p. 18). Dreams of the past are not helpful, and dreams of peril remind him to keep fighting.