As others have all mentioned it all depends on personalities of both parties, instinct strength, intelligence, and definitely supervision.
With my first guinea pig, I wouldn't have let her near our dog (though they only overlapped slightly in time). However, in this case it was almost more for the dog's safety, though I wouldn't put it past the dog to have done harm if it wanted to. It had made sure we never had pest issues by instantly destroying invaders on the few rare occasions. Not pretty clean-up. Our pig ATTACKED the dog though (seriously, she jumped off my lap, charged the dog, and gave him a hard blood drawing snap to the nose- it was a midsize irish terrier), however she was a vicious little critter. We couldn't house her with other pigs for she'd try to more or less murder them on sight (flying fur and blood if given a chance when on neutral territory and far apart to start, she'd charge) and I've definitely got scars from her. Highly territorial.
With our current dogs and pigs its a completely different situation. Our small dog (~5 lb) is still unsure of the pigs and generally avoids them, he might smell them or be interested in the droppings, but rarely gets very close, preferring to give them at least a foot of space. He has tried to instigate play a few times (bowing at them from a distance and running around away from them trying to get them to chase him, not direct contact- obviously this didn't work). However, he is very food motivated and so doesn't like it when they try to steal his food, so we try to avoid that issue for whatever consequence that may spur. This is an example of a situational issue possible with dog/pig relations. Even a dog that gives distance and isn't interested normally may respond aggressively if the pig violates some sort of social rule in doggy world and (un)intentionally cause excessive harm in what might be a normal social response to teach respect to other dogs (but is too harsh for a pig).
Our other dog (~15 lb) is motherly towards the pigs. He recognizes each of them separately and behaves differently with each of them. He knows to be cautious around Tobe for he is the least tolerant and may give him and nip if he gets too vigorous in his cleaning (and that licking the mouth is definitely not a smart move with that one). So he tends to only lick him a little bit, and mostly just cleaning the ears. Meanwhile he's very close with Logan who puts up with his cleaning and quite likes Monty (the dog). Logan will actively crawl over to Monty and try to get under him, or at least snuggle next to him. Tobe will also snuggle with Monty. All the pigs walk under and between his legs during floor-time if given the chance and they definitely sniff noses between the cage bars. Monty always has to check up on them when they make noise, and comes running to lick them if they start weeking while out of the cage. He also checks on them before bed. The pigs will try to steal food from his mouth if given a chance and Monty doesn't put up a fight over it. We still don't leave them alone together and are always within arm-reach during time when they're near. Most of the time Monty just tries to steal their food (since we've gotten the pigs he's gotten very veggy obsessive- if pigs can eat it he thinks he should too). The biggest issue is making sure Monty doesn't flop his fat butt on them when trying to get close since he can be a bit pushy in getting a spot on a pre-occupied lap.