Also, sleep cycles in dogs, as noted by scientists, are much shorter than in humans. For example, we might have 4-6 cycles of 90 minutes, and dogs about 15-20 overnight. In addition, during the rapid phase of sleep, they have the most vivid dreams.
Dr. Stanley Koren found that large dogs still have longer sleep cycles than small ones. For example, Chihuahuas dream every 10 minutes.
As for the barking during sleep, then at this moment the pet is most likely dreaming of what he usually barks at during the day. Nightmares are unlikely to be for them, but some traumatic events (memories of them) are possible.
If you want to wake up the animal, then this is not a good idea. This disrupts their REM sleep and interrupts their sleep cycle altogether. At best, as a result of this awakening, the puppy will be sleepy the next day.