Hedgehogs can undergo stress as result when other pets shower them with overenthusiastic attention. They may urinate or defecate as a result of their anxiety, fear, or nervousness. Restricting contact with other pets is the best way to address the problem. Also, you should take steps to prevent other pets from harassing your pet hedgehog while they are inside their enclosure.
Proper introductions are very important when bringing home a new hedgehog. For extra precaution, hold the hedgehog securely while making the introductions. This is particularly important if you have a multi-pet household. Hedgehogs are social animals and they can be quite friendly to other pets. Their quills can also protect them from the overzealous attention of other pets, thus they are likely to easily fit in and enjoy the company of other pets in the household. Some hedgehogs can be quite brave, and may try interacting with dogs which are way much bigger in size than them. Talk to your vet to learn more.