I have no idea. I think many higher mammals certainly have dreams – my cat and dog both do, sometimes they’re really funny when they’re dreaming, but I’ve never seen any sign of nightmares. I guess you’d have to be a ‘pig-dream investigator’ to answer your question – which is not a kind of scientist I’ve ever heard of.
Great question! The fundamental problem is – how would we know? What would be your experiment? I suppose the experiment would be to attach electrodes to the pigs head while they are asleep, and watch the brain activity, then compare it to humans that you have done the same thing to, and see if there are similarities. But there are lots of things that could be wrong – nightmares might manifest as different kinds of brain activity in different animals.
My bet would be yes, though. I think dreaming is probably a fairly common phenomenon, and if dreaming happens, chances are nightmares happen too.