Well, lets’ ask you a similar question. How would you feel if someone came into your room and woke you from a deep, restful sleep?
You’d probably be a little bit miffed with the person since many people struggle to get quality sleep. The same is true for dogs, who may take it a step further depending on the dog.
If the dog is older, in particular, you risk startling them badly. They may even try to nip you on reflex to being taken by surprise.
Of course, once fully awake, they’d probably be delighted to see you, but within the first few seconds of awakening, they may be accidentally vindictive of your actions. So there is a mild risk, but nothing threatening.