Chickens will occasionally eat poop. This is perfectly normal behavior for them and can actually be beneficial.
The poop of older chickens can serve as a probiotic for chicks.
When insects perch on poop, they lay eggs on it. Chickens can eat the insects, their eggs, and larvae.
Unless your animals are sick, there will be no harmful microorganisms in their poop.
Chickens scratch through everything in search of food. If you see your chickens eating or scratching through poop, do not be afraid because it is very normal.