If you observe frightening behavior in your dog during sleep then the first thing you need to do is take a video of the sleep disorder to show your vet. Now You need to know how to deal with your dog nightmares.
Decide if your dog should wake up:
When your dog is having nightmares, you may think your dog should wake up. But this is not always the best decision. Waking up your dog can be counterproductive. Your dog's sleep cycle may be disrupted, causing him to become distracted and possibly hurt you. Letting a dog sleep through nightmares is not always bad. But if your dog's nightmares last more than a few minutes, try to wake your dog gently. In your soft voice, try to wake the dog up. Don't attempt to touch the dog or push it.
Call him/her name softly:
Try calling its name in a soft voice instead of getting closer to your pet. It does not get up at once, so call it a couple of times, increasing the volume gradually. If he doesn't get up, he may have a seizure. Which would need veterinary treatment immediately. When it shakes uncontrollably, you will need to do this. Uncontrollable trembling, urinating or defecating, and stiff leg movements can include signs of a seizure.
Wait to wake up your dog:
Wait patiently until your dog wakes up on its own if you intend to let your dog continue sleeping. While it can be very distressing to hear or see your dog have a nightmare, note that dreams do not last forever. Your dog's nightmare will end and your dog can calm down again. Since waking up, dogs appear to forget their nightmares.
With quiet songs, soothe your pet:
Your dog can feel a little confused or disoriented when it wakes up from its nightmare. To help your dog calm down and feel comfortable again, put on some quiet, calming music. Do not touch your dog just yet, for your own protection, though. Before getting close to it, wait for your dog to be more alert and calm down.
Above all, when sleeping and awake, be closely observant of your dog's behaviour. Take videos of whatever you feel is out of the ordinary. Make an appointment with your veterinarian to discuss the issue, show the videos, and rule out any medical issues that might clarify the acts.