I mean... spitting at someone deliberately is definitely an offense. Wouldn't be surprised if it's considered assault tbh.
Absolutely think you should lose your job for it, no matter what job
I'm an employer. I can be absolutely sure if one of my employees did something like that outside their working environment it would not constitute a sacking. Its not something I want to think about in a working environment, but even if they did it in work, as an employer we would most likely go down the path of helping with anger management and try to understand how we have created an environment where such a thing could happen.