In general, by far the most recommended and best option is to keep your hedgehog away from other pets. Hedgehogs are not social animals and introduction to other pets has very little benefit for them, and can have serious consequences. However, sometimes people feel that's not really reasonable in multi-species households and want to know how to best make sure everyone stays safe & happy. The biggest thing is to know your pets. Most animals won't want to mess with a hedgehog once poked, but that doesn't give you a guarantee. It only takes a split second for something to go wrong.
Cats and hedgehogs can coexist peacefully, especially once the cats discover that the hedgehogs are covered with quills. Even the most stubborn cats will give hedgehogs a wide berth once they've had a poke in the nose or on the pads of their feet.
The secret is to introduce the two together by holding the hedgehog in your arms, then allow the cat to come up and investigate the hedgehog. Have a second person nearby & able to quickly remove the cat if a negative interaction takes place. In most cases, a quick nose-full of quills later and your cat will have gained a lifelong respect for hedgehogs.
In general, the rules that applies to cats will likewise apply to dogs, but you must be very careful when dealing with large breed dogs, breeds that are bred to hunt small mammals (dachshunds, terriers, etc.), and those with obsessive tendencies.
Any time you introduce a dog to a hedgehog, you should have at least two humans present, one to hold the hedgehog, and one to control the dog. It would be best to have the dog on a leash so the human in charge of them can quickly have control over the dog's actions.
If you own a dog with a high hunting drive, a large amount of energy, or that is unlikely to be deterred by one or two pokes from hedgehog quills, it is best to never introduce them. Your hedgehog's safety and comfort is the most important thing in this situation, not your dog's feelings or curiosity.
Hedgehogs and ferrets should never interact, PERIOD. Ferrets are high energy, high prey drive predators. Regardless of whether you know your ferret only wants to play, your hedgehog will not know that. Hedgehogs that may not feel threatened by dogs or cats will often be terrified by ferrets. Never have a ferret and hedgehog out at the same time, and do not house their cages in the same room. If you own ferrets and hedgehogs (or other prey animals), make absolutely certain that your ferrets' cage is completely escape-proof.
Rodents & Other Small Pets
Hedgehogs should never be housed with other small mammals such as guinea pigs, rats, etc. Hedgehogs may get along fine with these animals in a common play area just fine, but this isn't recommended. It's very easy to keep these animals apart. As already mentioned, hedgehogs are not social animals and are unlikely to gain much from these interactions. Hedgehogs and other small mammals could potentially pass illnesses between themselves. And there have been cases of animals such as guinea pigs & rabbits chewing on a hedgehog's quills, which can open the hedgehog up to serious infections. If the animals don't get along, it'd be very easy for one or the other to get hurt due to quills, biting, nails, etc.
If the worst ever happens and a larger predator such as a dog or cat gets a hold of your hedgehog, always immediately go to the vet. Even if your other pet wasn't trying to hurt the hedgehog (such as a dog “retrieving” the hedgehog & just wanting to carry them in their mouth), it is very easy for larger animals to hurt a hedgehog by accident. Your hedgehog's safety is your responsibility.