This is not quite true. While eggs and poop come out of the same orifice, while laying the egg the uterus extends a bit out of the body, so there's no chance the egg would come into contact with poop.
If you were thinking like a chicken, you’d see that it’s inevitable: at some point in time, the egg is under the butt. One of the most important rules of being a chicken is to make sure that any clean thing under the butt is immediately pooped on.
The only known exception to this rule is other chickens. I’ve never seen a chicken poop on another chicken.