The same drug is used to prevent heartworm in dogs. The dog has to be tested though, because if there are already worms, the dog could die from the medication.
At least that is the general theory.
Ivermectin will rip your liver to shreds if not administered carefully.
If you are treating your dog and/or cat for heartworm, your are also treating a bunch of Africans for river blindness: http://www.americanscientist.org/issues/page2/ivermectin-and-river-blindness
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.
“The same drug is used to prevent heartworm in dogs...”
Are you referring to Ivermectin? Ivermectin is commonly used to rid horses of parasites. We have horses, but we do not use it because diatomaceous earth is better, and is not hard on the horses.