Heartworm is a disease caused by a parasitic heartworm Dirofilaria immitis. Heartworm is transmitted by mosquitos, who feed off of an infected wild animal or other mammal, and then bite a dog or cat and deposit infective larvae to the new host.
Ferrets, unlike dogs, are not natural hosts for heartworm. In dogs, worms can can mature, mate and reproduce. In ferrets (and cats), most worms do not survive to adults.