Chicks get worms from free ranging and/or by being in proximity to feces of adult chickens. Chicks are very unlikely to have worms before they join the adult flock, and then if the adult flock doesn't have worms, the chicks are unlikely to have them as well.
So, how do you know if your flock has worms? Easy. Gather a couple of random stool samples from the coop or run and ask your regular vet to run a fecal float test. It's inexpensive and will tell you if worms are present at a level of concern, and also what species they are so you can target them with the most appropriate worming med.   
What do you do if your vet refuses because they don't "treat" chickens? Find a new vet as refusal to do this simple test as a courtesy is stingy and unacceptable. My vet charges about $20 and is happy to accommodate me even though he doesn't treat chickens.