Dogs exposed to contaminated soil or feces, grooming or licking by an infected animal or contact with mosquitos can result in worms in dogs. Depending on the type of parasite, infections could affect the heart and arteries, lungs, intestines or skin, and side effects might include diarrhea, vomiting and lethargy. How do dogs get worms?