Essentially hedgehogs will not really “get along” with other pets like cats and dogs (as they are simply too different to be companions) so much as “learn to live in the same household.” The first and most important consideration is your pets’ safety. A hedgehog’s quills will protect him or her from more cautious cats or dogs, however keep in mind there are always some animals that will not be deterred and will always see your little pet as lunch.
Make sure your hedgehog’s cage is out of your dog or cat’s reach and I also highly recommend adding a secure top to the cage if you would otherwise leave it open. Keeping your hedgehog higher than a dog can reach will prevent excessive sniffing in the cage area, which can be very stressful for your hedgehog and not good for his or her health