Yes, llamas may spit if they are upset,
but it will normally be preceeded by a warning
by the ears going back and the head tilted up.

If you are aware of their body language,
you usually can avoid any problems.