The act of eating raw cookie dough itself is not necessarily dangerous. A number of sources warn against eating it, however, specifically that which is homemade. The reason for this has to do with a difference in one key ingredient included in homemade cookie dough, which is not usually found in store-bought cookie dough nor in the cookie dough used to make ice creams and other desserts. This ingredient is raw egg. While eating an excessive amount of any raw dough may cause a stomachache, it is not potentially dangerous unless it contains raw eggs.
Cookie dough is the mix of dry and wet ingredients that is divided into portions and baked into cookies. Aside from being an unfinished stage in the cookie-making process, one might say that the dough has an identity all its own. Raw cookie dough is an ingredient in a variety of other foods, such as ice creams, cakes, and candies. It's even eaten alone at times, either as a sample before baking a batch of cookies, or straight out of a pre-made cookie dough package.
Raw eggs may contain salmonella, a species of bacterium that can causes serious illness. It is the risk of salmonella that makes raw eggs and raw cookie dough potentially dangerous. When heated to a certain point, the bacteria are killed, rendering them harmless if they happened to have been present in the egg. This means that, during the baking process, the potentially dangerous homemade dough becomes a completely harmless, and often delicious, homemade cookie.
Pre-made raw cookie dough that can be bought at the store usually does not contain uncooked eggs, although it often does contain pasteurized eggs. These are, in effect, uncooked, but they have usually been heated or “flash cooked” to a temperature that is sufficient to kill any bacteria that can be dangerous to consumers. Uncooked egg is included in cookie dough as an emulsifier that is important in the baking process. The raw cookie dough found in ice cream, cake, or candy is not meant to be baked, and for this reason, it usually does not contain any egg.
Pasteurized egg can be bought separately in stores and used instead of raw eggs in a homemade cookie dough recipe. Raw cookie dough made at home with pasteurized eggs can be eaten raw without the risk of salmonella poisoning.