One of the earliest things any aspiring writer learns is never to finish your story by having the character wake up and discover that everything that just happened was ‘Only a dream, after all’. I remember getting that pretty much beaten into me at primary school level.
It’s wholly reasonable to avoid that as a twist ending, of course: it’s similar to the classic deus-ex-machina and lets the author get out of the hard work necessary to bring a complicated plot to a satisfactory conclusion.
Starting a story with the protagonist waking from a dream isn’t as much of a cop out, and isn’t necessarily bad writing, but it’s a trope that’s getting a bit overfamiliar, especially in erotica and erotic romance, so probably best avoided. Opinion is still rather mixed on whether it’s acceptable to describe a dream a character has at some point in the story, though context and tone are pretty important if you want to include a dream sequence.
It’s fairly widely agreed that dreams come from the unconscious/subconscious, and can sometimes remind a person of something they had overlooked or misunderstood, just as doing something else to distract you from a complex problem can sometimes allow the solution to float up from the depths of your mind. You can get away with that sort of thing, even in the most hardheaded realist genre of story, but if you’re going to have a more literally useful dream where a supernatural being or dead lover pops up and spells out all the answers, you’d better have at least a hint of paranormal in your plot for this not to be jarring or thoroughly absurd.
Mind you, sometimes a dream of the utterly random variety, that you actually have for yourself, can serve as the starting point for a story. I’ve had it happen a couple of times: the dream seemed to make perfect sense while it was taking place but, when I woke up, I realised it was a bizarre muddle – and spent the rest of the day unpicking all the ‘what if?’ and ‘why’ from the bits of it I remembered most clearly. In both cases, the story I ended up with didn’t bear all that much resemblance to the events of the dream, but having dreamt something strange had given me a core concept I might not otherwise have come up with.
So it’s back to bed for me, to see if my subconscious has any ideas to liven up the current story, which is going nowhere fast…