It mostly does have to do with raw eggs than just cookie dough in general. Although a lot of people eat/drink raw eggs regularly anyway. Which by no means it's not a risk, just adding information to the discussion
Actually, at least in the US, it's the raw wheat (flour), not the raw eggs that tends to be the bigger problem in having bacteria that will cause sickness when eating raw cookie dough.
If you look on the FDA site for their article "Raw Dough's a Raw Deal and Could Make You Sick" from last year there are more details including:
"Flour, regardless of the brand, can contain bacteria that cause disease. In 2016, the U.S. Food and Drug Administration (FDA), along with the Centers for Disease Control and Prevention (CDC) and state and local officials, investigated an outbreak of infections that illustrated the dangers of eating raw dough. Dozens of people across the country were sickened by a strain of bacteria called Shiga toxin-producing E. coli O121 ... And don’t make homemade cookie dough ice cream either. If that’s your favorite flavor, buy commercially made products. Manufacturers should use ingredients that include treated flour and pasteurized eggs."
"Flour, regardless of the brand, can contain bacteria that cause disease. In 2016, the U.S. Food and Drug Administration (FDA), along with the Centers for Disease Control and Prevention (CDC) and state and local officials, investigated an outbreak of infections that illustrated the dangers of eating raw dough. Dozens of people across the country were sickened by a strain of bacteria called Shiga toxin-producing E. coli O121 ... And don’t make homemade cookie dough ice cream either. If that’s your favorite flavor, buy commercially made products. Manufacturers should use ingredients that include treated flour and pasteurized eggs."