If you visit a foreign country you need to learn about the laws that may affect you. Plenty of sources for that — travel guide books, State Dept. web site.
As for digitally participating, you probably can’t face prosecution outside the country, but if you visit later you might get arrested. Violating Thailand’s lese majeste laws is not a crime outside of Thailand, for example, but you can be held responsible for social media posts if you come under Thai jurisdiction.