A Facebook post circulated in March 2019 that purported to offer a photograph of the heart of a child who died after contracting parasites from sleeping with and kissing a domesticated dog. “A bad practice is to humanize pets. I’m sending you a kid’s heart that, due to sleeping and kissing his dog, it transmitted its parasites," the post warned. "Those parasites blocked his heart and he died here at the Children’s Hospital. Please forward this to family and friends”:
In fact, this photograph was taken from a 2012 paper published in the journal Clinical Microbiology Reviews, where it was captioned as picturing "Male and female adult worms of D. immitis in the heart of a dog," not in the heart of a human child.
D. immitis (or Dirofilaria immitis), commonly known as "heartworm" or "dog heartworm," is a parasitic, thread-like roundworm that is spread via mosquito bites. D. immitis infections cause dirofilariasis (also known as “heartworm disease”), which can be fatal to dogs if left untreated: "D. immitis adult worms can cause pulmonary artery blockage in dogs, leading to an illness that can include cough, exhaustion upon exercise, fainting, coughing up blood, and severe weight loss.”
However, as the Clinical Microbiology Reviews paper noted, "humans are not suitable hosts for Dirofilaria species," and one of that paper's illustrations shows that Dirofilaria infections in humans do not spread to the heart:
As the Centers for Disease Control and Prevention (CDC) stated in an article about dirofilariasis, humans become infected with Dirofilaria through mosquito bites (not from physical contact with infected canines); reported cases of infections in humans are quite uncommon; and D. immitis worms are rarely found outside the lungs in humans:
Like dogs, humans become infected with Dirofilaria through mosquito bites. In persons infected with D. immitis, dying worms in pulmonary artery branches can produce granulomas (small nodules formed by an inflammatory reaction), a condition called “pulmonary dirofilariasis” ... Rarely, D. immitis worms have been found in humans outside the lungs, including in the brain, eye, and testicle. A review of cases of human dirofilariasis in the United States published in 2005 lists a total of 81 cases reported in the literature since 1941, the year of the first reported case.
A Healthline article that specifically addresses the issue of "Can Humans Get Heartworms from Dogs?" reiterates these same points — heartworm infections in humans are rare, aren't transmitted by contact with dogs, don't occur in the heart, and aren't fatal:
Heartworms are rarely transmitted from dogs to humans. In fact, only 81 cases of heartworm in humans were reported from 1941 to 2005.
Both dogs and humans can get heartworm infections. But your dog can’t give it to you through their bodily fluids. Heartworms get into the bloodstream of both humans and dogs through mosquito bites.
The symptoms of heartworm infections in animals and humans differ because of how they develop in the bloodstream. You may not always experience any symptoms because the heartworms will die before maturity in a human host.
In humans, heartworm larvae never fully mature. As young heartworms die, your body reacts to their tissue with inflammation as it tries to destroy the heartworms. This condition is known as pulmonary dirofilariasis.
Heartworms don’t live long in human blood, so you won’t need to have heartworms removed through either medication or surgery. Treatment for heartworms addresses any granulomas that appear on an imaging test that may have resulted from dead heartworm tissue buildup in your arteries.
If a granuloma isn’t causing any symptoms or blockage in your arteries, you probably won’t need any further treatment.
In short, you can feel secure that your children's cuddling the family dog will not result in any of them contracting a fatal case of heartworm.