Especially newborn puppies have a high risk of getting infected with worms from the milk of their mother. Sometimes they can already get infected in the womb. Besides that, dogs can get worms by eating contaminated stool.
Worm treatment can be harsh and some puppies may experience dizziness and diarrhea. You have to keep in mind that worm treatment only has an effect for 24 hours, killing all existing worms. Even one day after treatment, your dog could be infected again.
Everybody has their own opinion on this but I do not want to pump de-worming products into my puppy on suspicion. That's why I always get her stool examined before deworming to see if she has any worms at all.
Fecal exams at a vet cost about $30 and all you need is a fresh stool sample. This test will provide you with the safest results and your veterinarian will be able to recommend treatment based on the diagnosis.