Worms in dogs have various causes, according to WebMD. Dogs can get roundworms through feces or while pregnant or nursing, and they can contract tapeworms from swallowing fleas or licking themselves.
Mosquito bites transmit heartworms to dogs, WebMD explains. Adult dogs can get hookworms while grooming themselves, and mother dogs can spread the worms to their puppies. Ringworm is not a worm but a fungus that causes a skin infection. Dogs contract it when their skin touches fungi spores, frequently in dirt or on cats. People can get ringworm from their pets as well. In most cases, those worm conditions can be treated with medication. Preventative medication also helps keep many cases from occurring.