You only get worms from your dog if you come in contact with its faeces. If your worm-infected dog passes stools, clean the area thoroughly and wash your hands immediately as well. Do not let children in the area where the dog has passed stools either.