Sleeping dog probably dreaming
When your dog is whining and running in his sleep, is he dreaming? Chances are good that he is.
Dogs definitely remember things, so it makes sense to believe they have the ability to dream, just as people do. After all, dreaming is a normal part of organizing and reorganizing memories.
Like humans, dogs have two kinds of sleep. The deeper kind is characterized by rapid eye movements, so it's known as REM sleep. We know humans dream during REM sleep. We also know the whining, heavy breathing, twitching and leg movements we've all seen in our dogs occurs during canine REM sleep. So it's not farfetched to believe dogs are dreaming, too.
We may never know for sure exactly what they're dreaming of, but any guess that involves food is a good one.