Yes.
It is a crime almost everywhere to throw something at someone, even if it causes little or no injury. Usually it would be classified as "assault and battery" although if it damages clothing or other property, it could also be called, for example, "criminal mischief" which is intentional damage to property.
It would also be a tort that could be enforced with civil damages in most places, although only nominal damages would be awarded and there would be no award for attorneys' fees.
In practice, however, few people would press charges or turn to the police in such an incident, few police would take action based on the complaint because it is so trivial, and few people would sue in such a case.
For what it is worth, the "living law" in Japan recognizes that someone has a duty to pay to clean your clothes or replace them if they can't be cleaned in such circumstances and most people appear to comply with that obligation without court involvement if the victim insists.
Also, pie throwing as a political protest in Europe is also almost surely illegal under European law, although, again, this is rarely enforced by common political culture and tradition.