The dog eats snow and ice for two reasons: either due to thirst or because it’s fun.
When a dog is outside, cold weather, or generally cool air, dries out the mucous membranes. So it’s not so much about pure thirst, but rather a dry mouth. If the dog is also frolicking in the snow, it gets hot, which further increases the feeling of thirst. More accurately, it’s just about cooling down. The same reason why a dog happily flops down in the deep snow to pant.
Some dogs specialize in ice. It’s purely a play activity, exactly the same as gnawing on sticks. The difference from sticks is that ice is not dangerous.
In many ways, dogs are similar to small children. They do something simply because it seemed like a great and wonderful idea at the moment. Children don’t eat snow from their mittens or suck on icicles because they’re truly thirsty.
In practice, eating snow and ice is not dangerous, but for dogs with sensitive stomachs, a large amount of cold in the stomach may cause issues, such as heartburn. If snow is shoveled in large quantities, the increased amount of water will come out with some delay—usually once they’ve gotten back inside. So throwing snowballs for a dog is a fun game, but if it becomes an obsessive activity, it might be worth limiting it to some extent.