Thanks for the "like story"... I hope the reason this post doesn't see more input is the condition is very uncommon, maybe limited to dogs that had some rough life-treating experiences.
Our guy started whimpering this morning at about 4 AM, he could not be consoled by me reaching down from our rather high bed to pet and rub. I don't know how he woke up, I was sleeping, but seems there was no barking. I got and tried to get him to go down stairs and outside - no go. So I sat in a chair and he, no lap dog, came over to me so I picked him up He looked confused (he has been in my lap a few time,so this was not a first) and then started to fight to be put down. I put him down as quickly as I could and he turned toward me and barked loudly. Looked as if he was telling me off. So I, again, tried to get him out of the bedroom, down the stairs and outside. After the pick-up episode and barking he willingly followed me down to the front door and out. It is cold for NJ, was about 15 degrees I'll guess, so he was back to the door in a couple of minutes. I returned to the bedroom and bed, he did not follow. When I awoke after daylight and got up I saw he was laying between my nightstand and the corner wall, a bit cave-like, protected on three sides. Previously he as always slept in is dog bed on my wife's side of our bed. He got up and went downstairs and out, came in and had some breakfast, but he continues to stay very close to me, seeking security it seems.
Was the trigger a dream? Seem likely.
I have a 10 yr. old rottweiler. I rescued him when he was 6. I don't really know what kind of life he had, but from how skinny he was and the hair that was missing because his collar was way to tight, I can only guess he was tied up outside and forgotten about. At least twice a week I'll hear him in the middle of night whinning and crying, kind of moaning. Then suddenly he'll let out a bark and jump up. I'm not sure if it's because he just woke himself up, or the dream he was having made him bark at something. (He's not normally a "barky" dog--so when he does bark like that out of the blue, I know he's dreaming) Occassionally he'll let out just the most horrific howl, like he's in major pain. It took me a few times of sitting up with him for a few hours before I realized he was dreaming when he was doing this.
So, to answer your question, yes I think it's possible that there may be some not so nice memories that he dreams about.
My friend had a scottie that didn't like men who wore hats--no idea why, but we can guess he was abused at some point by a guy in a hat. I think they remember more than we give them credit for.
If you haven't already, you may just want to mention it to your vet the next time you go in and see what he/she has to say. He/she may be able to offer some advice or give you something to help your pooch relax more.
Good Luck.