I agree with the advice and information given above, with one exception. Most worms are species specific. Your dogs can't give your chickens roundworms nor vice versa. That particular cross is not possible. (Some roundworms can infect different species, like goat to cow I believe, but canine to poultry is not one of them.)
Of the poultry type worms, only roundworms can occasionally migrate to eggs, which would be totally yucky to find. The rest stay within the body of the bird (causing general havoc to the gut and immune system). Worm overload can easily cause unthriftiness and anemia. Lowered production is a common result, and even death in extreme loads.
Roundworms typically look like thin spaghetti in poo. It is one of the few worms you can see with the human eye. Cecal worms are tiny thread like in appearance and appear in the cecal. Capillary are another type but are so small they are not easily seen by the naked eye. None of these worms need an intermediate host. They are picked up through direct contact. Eggs (or young worms) in feces eaten as the next bird pecks the soil.
If you can easily see the worms, it is almost assuredly roundworm.
It takes 3 weeks for the roundworm cycle to complete from egg to adult worm laying eggs, so worming once and waiting will not eradicate the next generation as the wormers only kill the adults. You have to treat, then treat again. Most literature recommends monthly treatment for roundworm infestation due to its specific cycle....generally at least twice, often more if land is limited or litter is not easily changed.
After the second treatment, it is good to clean up or rotate your litter or range. For a limited range situation, putting pine shavings or another layer of amendment on top of the soil helps bury the eggs and protect against immediate transmission to lessen the cycle occurrence.
If you see worms, that bird is showing a heavy load, and there are most certainly worm eggs in your soil. Almost all chickens have worms and tolerate a certain level of worm load. Not all birds will have the same loads. It does tend to build up in certain hybrid/breed types and those birds with lower resistance.
Environment plays a big part too. In areas with heavy freezing and dry ground, worm transmission is limited and often those folk see little need for worming as healthy birds keep the load naturally in check. Those of us in moist soil (like my continually milder wet Oregon) and limited field rotation (like most backyard chicken owners) usually see the need to worm periodically at some point.
Herbals can help keep low levels in check. Herbals at best flush live worms from a chicken's system, however, that leaves both live worms and eggs in the soil to continue the infestation cycle (be it direct or through host). Without regular field rotation (with a chicken tractor like my son-in-law who is an organic farmer who rotates through about 5 acres), it is inevitable that susceptible ground within time will become heavier with worm load.
I use herbals between wormings to help keep worm loads down between seasonal worming....because I live in a milder, wetter climate with limited field rotation.
It is best to rotate your worm medicines between 2 or 3 types using A in the fall, B in the spring, then A (or C) in the fall again.
The FDA has made it very difficult to take care of chickens as all worm medicine has been moved off the approval list for chickens laying eggs for human consumption. That means if you treat, technically you are never to use that chicken again for egg sales. However, that is only the larger operations that must comply with FDA inspection.
Those of us with small holdings generally withhold eggs for 2 to 3 weeks. Why? Generally it is not really the safety of the egg as most worm medicine infiltrates the egg in very small quantities. Granted, there are those individuals who may be sensitive, but most of the worm medicine used for chickens is also used for people. The amount a person could get from the egg would not be enough to be a human dosage, even with accumulative effect.
Withholding is so that should your eggs be tested, no residue would be found as the substance is considered non-approved by the FDA (therefore "illegal" use). There are no egg police for small holders (those under 3,000 birds) as there are no small holder inspections nor market inspections (since most of us sell in the farm to consumer direct clauses...check your state).
If a small holder has need for their eggs to be tested (it will be because someone got sick and thought it was your eggs), and residue was found, the small holder is then liable for all FDA penalties.
I personally don't toss the eggs (if it is a wormer used for humans too...which I make a point to use). I keep eggs for family consumption only during worming season, tossing the first 3 days when the wormer med has reached its highest absorption point. (It varies with the wormer). I feel that is totally fine medically for my family. The FDA doesn't care what you do for your own family. It is only concerned with eggs for consumption by friends and customers.
I wait until at least 2 weeks after the last worming to sell eggs again. (Some of my customers don't care, and they know).
Generally I worm at the beginning of fall and at the middle of winter when egg production is lower. Summer also brings warmer drier weather so I don't have to worry so much then. (Be forewarned that fenbendazole has been implicated in funky feather regrowth if administered during molt).
I personally have curtailed sales as it has become a hassle with the FDA withdrawal of all approved wormers from the consumer market. I miss Hygromycin B which was easy to give and had no egg withdrawal. But alas, the FDA saw fit to withdraw that too.
You can read through withdrawal suggestions in the following FARAD literature. Mind you this came out before the new 2017 sanctions that essentially removed all worm meds from the poultry market, however, it is still beneficial for the small holder.
And continually check with the FDA/FARAD rules as they change regularly. There may be stuff back on the market in time again.
LofMc
https://vet.osu.edu/sites/vet.osu.edu/files/documents/extension/Egg residue considerations during the treatment of backyard poultry 2015.pdf