@Marlborus There's usually no way to get a pet back after the social worker has taken it. And without mods, there's no way to remove the pet from the relationship panel either; you'd need to wait for the game to delete that data on its own.
If you use mods or are willing to add a few, please add NRaas MasterController, along with ErrorTrap and Overwatch. MC doesn't do anything unless you use it to issue a command; the others do their job in the background, without any need for user input. In this case, they're here to clean up any corrupt or stray data associated with the pet. You can find descriptions and links in this post, along with a link to instructions for installing mods:
https://answers.ea.com/t5/Technical-Issues-PC/Sims-3-Common-Game-Fixing-Mods-Hero-Approved/m-p/9838855#M244208
Once you've added the mods and deleted scriptCache.package, load your save, click on your active household's lot (the ground, the walls, the map tag) and select NRaas > MasterController > Add Sim. Choose Species as the filter, then Dog: [size] (choose whichever size of dog you had), and if your old pet is on the list, choose it. Once the dog is back in the household, click it and select NRaas > MC > Advanced > Reset Sim, just to be thorough.
If MC can't add the dog back to the household, please add NRaas RelationshipPanel as well; there's a link in the next post of the thread above. Be sure to delete scriptCache.package again. Load the save, then ctrl-click on the dog in each of your sims' relationship panels to remove it.