Yes snails can and do spit saliva out but it looks a bit different than a human spitting saliva.
When I was a kid I remember seeing a snail in my yard and playing with it and it decided to spit at me but from what I remember the snail looked like it was smoking instead of actually spitting.
But I researched alter online myself that snails do indeed spit and what I had seen was the snail spitting.
Snails have a venomous saliva to kill it's prey with so they can spit on their prey and then it kills them so that they can eat the thing they killed.
The snail can also take down a starfish with it's saliva which is called snail mucus and it's poisonous to starfish and other prey of the snail.