If a hen lays an egg a day, after 10 or 12 days or so, she has gathered a clutch together and will begin sitting on them to hatch them. The first egg she laid has been sitting in the nest for two weeks or so, but is still good enough to turn into a baby chick!
Commercial eggs must be sanitized because they are often laid on top of feces---or even worse.
While eggs may store best without being washed, you will want to wash soiled eggs prior to cooking. Some people recommend you use sand, sanding sponges, or sandpaper to carefully buff off the dirt. It's probably best not to wash them in water as that can spread the bacteria to the inside the eggshell. But if you do use water, your solution should be about 20 degrees warmer than the egg you are washing to reduce the number of bacteria you are driving in (as the egg cools, what is on the shell will be drawn inside, and if you have removed the bloom, the bacteria will enter). You might also consider using products specifically designed for egg cleaning as a safe and effective alternative to using soap and water.
If you sell your eggs, you will need to comply with all relevant regulations that apply to your situation. You cannot sell poopy, stained eggs for consumption. It seems like a waste, but if an egg is very soiled or caked with more than just surface dirt, sometimes it's not a bad idea just to toss it out.
In addition to handling your eggs properly prior to cooking, it is very important that eggs be cooked thoroughly to kill any bacteria that might have gotten into the egg. The USDA offers the following advice for cooking eggs properly:
Many cooking methods can be used to cook eggs safely including poaching, hard cooking, scrambling, frying and baking. However, eggs must be cooked thoroughly until yolks are firm. Scrambled eggs should not be runny. Casseroles and other dishes containing eggs should be cooked to a safe minimum internal temperature of 160 �F. Use a food thermometer to be sure.
Keep in mind that if you are consistently getting very soiled eggs, you should consider changing your flock management practices. Check to see if one of your birds is ill and that's causing loose droppings. Determine if your hens are sleeping in the nest boxes (and pooping there!) rather than on their roosts. Maybe you will need to change the height of the nests or the roosts, or darken the nests so they will be less inclined to do anything in there other than lay eggs.