Horror stories and movies about sleep are an interesting bunch. Certainly Nightmare on Elm Street is by far the most prominent example. Freddy Krueger has evolved into the ultimate sleep boogeyman. But the trope itself is very widespread.
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.