This mod was created because I didn't want to lose any pets to shenanigans that happen in modded and vanilla Minecraft.
The mod works by detecting when an entity has been tamed and applying the invulnerable NBT tag. The mod also provides retroactive application by right-clicking on a tamed entity.
There is a basic config included with an enable/disable option, a whitelist, and a blacklist. The whitelist is a list of entities that you want the mod to solely apply to and is empty by default, letting it apply to all entities. The blacklist is a list of entities you do NOT want the mod to apply to and is again empty by default.
Theoretically, this mod should only be incompatible with a mod trying to do the opposite (which, if so, what the heck?) or bypasses the invulnerable tag (like a player in creative mode can do). The mod should work with any entity that either uses the Minecraft taming event code or is classified as an ownable entity. At this point I have not looked into what entities these criteria could apply to in other mods, but there is the possibility of unintended side effects with, for example, summoning mods like Occultism, if the summons are classified as ownable entities.

