I believe in the case of a dog with heartworms, the dead worms can come loose, clog stuff up and cause a stroke. The dog must be sedated and kept still while the dead worms are disolved or adsorbed into the system.
Oh Dear..That’s awful. ((((shudder))))
I live in a semi-tropical place, and we have to be very careful about heartworm in dogs. Lots of mosquitoes, which carry the microfilarae, abound in the Everglades!
Not to mention Alligators, Crocodiles, and our newest pest, Burmese Pythons.