Used poorly, a nightmare in a movie or story can be just a cheap jump scare without having your protagonist in any real danger. But when used effectively, sleep can be a great way to introduce character, motivation, and trauma. Dreams can be a doorway into our psyches. Dreams can be a harbinger of doom.
Dreams are a great tool in the storytelling arsenal. And all are ways to make a horror tale just a bit more fascinating.