Guinea pigs are prey animals in the wild and are often uncomfortable near predatory animals like cats and dogs. It’s best to keep cats and dogs away from your guinea pig to minimize its stress.
In cases where cats and dogs ignore the guinea pig and don’t sit in front of its cage staring at it (a very stressful situation for the guinea pig), you can allow your other pets to be in the same room, but only if the guinea pig is safely inside an exercise pen or inside a cage. Keep a close eye on your guinea pig for signs of stress, including hiding, reduced appetite and more sleeping than normal. If you see evidence of stress, keep your cat, dog or other predatory animal away from your guinea pig.