How can I clean up devices and entities?

I have some unused devices, but I can’t delete them. For example I have some no longer existing templates from my Fritz!Box or multiple entries of the same smartphone. I can only deactivate them, but I can’t delete them.

Is there a way to delete them or can I safely delete and add the whole integration without breaking scenes or automations?