There is no rule that plant based food is safe to be eaten raw. Also, on a side note, the salmonella reasoning was somewhat misguided - not that it isn't a risk, but it isn't the reason why cookie dough is not intended for raw consumption.
When determining food safety, one doesn't ask "where will the bacteria come from", except in some very special cases (eggs are one of them). Bacteria, yeasts and mold spores are always present everywhere, on all surfaces in the kitchen, in the fridge, on our bodies, and in the air. The question is not "will it have bacteria", but "will bacteria grow in it".
And for the "will bacteria grow in it", the answer is by default "yes". For the answer to become "no", there has to be a special reason. For example, raw fruit and vegetables are still alive after picking and can resist bacterial infection (else they would have rotted on the plant). Dry foods such as ripe beans don't contain enough moisture for bacteria to grow. Preserved foods have had some necessary factor taken away. And so on.
Cookie dough doesn't fall under any of these exceptions. For all intents and purposes, it is a raw ingredient, which has to be cooked within 3-5 days of making, and stored under refrigeration in that time.