Tapeworms come from your dog eating fleas, or any dead animal such as moles, gophers, mice, rats, squirrels, etc. They can also get it by coming into contact with other dog poo that is infected with the worms. I hope this helps. There may be other ways to this is just what I know.