Would it be advisable for an American citizen in a country such as Saudi Arabia to protest a deportation as racist or bigoted, after having entered that county illegally, or having remained in that country illegally once the visa expired?
...to abide by their customs is heart to heart communication. Absolutely I say to your question. We are under their laws if we are in their country, besides in showing respect for their laws and customs makes one easier to be welcomed into their country. Many are trumps when they go into another country, loud, boisterous, throwing big egos around, and showing no respect for others. It builds opinions about this kind of behavior ...hence the Term "Ugly American", which I am sure you have heard of and imho it is true with my feelings in this case. In my experience, (18 countries) Americans are the worst (I am an American) and Have seen it too many times around the world. Not Putting down America, I love it. But our respect for other cultures should be carried with us always.
Not just Americans. Anybody who visits another country had better be prepared to respect their laws. The media is never short of stories about tourists who get into trouble for all manner of breaches.
Other than just tourists, does your answer also encompass people who enter another country in a manner contrary to that country's immigration laws, or who enter that country legally, yet remain beyond the expiration of their visas, thereby becoming out of legal status?
Of course. I quoted tourists because they're the people who keep making sensational stories in the media. So, yeah, illegal immigrants and overstayers are in the same boat. So is that Ameican Christian who was arrested in North Korea a few years ago for distributing proscribed literature.
One further expansion upon your answer string, if you don't mind: does that also work conversely for citizens of other countries who are in the United States, should they be expected to respect the laws of the United States?
If you read the first two sentences of my answer you'll see that I moved away from "Americans" to "Anybody". So, yes, of course it applies to foreigners visiting the US.