Can Dogs Have Nightmares?
Dogs CAN have nightmares.
More Info: Because your dog can't communicate, it is difficult to know exactly what he is dreaming about, but science reveals that dogs do enter a dream-like sleep state like humans.
Dogs Experience the Same Sleep Patterns as Humans
The dog's brain is similar in structure to that of humans. During sleep, their brainwave patterns follow the same stages of sleep that humans do. Dogs enter an REM state just like humans, which is when dreams and nightmares manifest. 
MIT Study Provides Evidence That Animals Dream
Researchers from the Massachusetts Institute of Technology have provided evidence that animals do indeed dream; and in fact, they experience complex dreams. In the study, the researchers monitored the brain activity in rats while they ran through a maze, creating a distinctive pattern of firing neurons. The brain activity was then measured while the rats were asleep and more than half the rats displayed the exact same pattern they had while awake. The researchers reported that in some of the rats, the patterns were so similar, they could estimate exactly where in the maze the rat was in its dream.
This measurement of the brainwaves provided evidence that the rats were replaying events from the day. 
Do Dogs Dream?
It follows that if rats dream then a dog with a more developed brain would as well. Research on the brain-wave patterns and electrical activity of sleeping dogs indicate that during sleep, the dog experiences those similar to humans. When the portion of the brain stem that suppresses the acting out of dreams is inactivated in dogs, they began to perform expected dog activities during sleep. Observing your own dog while dreaming can confirm these findings as his little legs are racing to chase something. 
Dreams Differ among Breeds
According to Dr. Stanley Coren, professor of psychology at the University of British Columbia, and sleep expert for both pets and people, different types of dogs experience different patterns of dreaming. He notes that small dogs tend to dream more than large dogs, and that younger dogs spend more time dreaming than older dogs. On average, a middle-age dog sleeps 14-16 hours per day. 
Why Do Dogs Circle before Lying Down?
There is much supposition as to why some dogs circle multiple times before lying down. A quick internet search will provide a variety of hypothesis. Old folklore suggested that it was a way to scare off the snakes in the area. Another hypothesis is that it is a defensive measure to investigate all surroundings before relaxing. The most common answer, as well as possibly the most likely, is that wild canines circle simply to trample the grass and underbrush to get more comfortable and this trait has been passed down genetically. 
What to Do If Your Dog Has Nightmares?
Just like humans, dogs need periods of uninterrupted sleep to stay healthy. If your dog has the occasional nightmare, allow him to sleep through it. Veterinarians suggest not waking the dog unless the nightmares go on for long periods or if he begins to display signs of sluggishness while he is awake.