These days, Customs and Immigration are often combined into a border protection agency and it can be difficult to tell who's who.
Customs in most African countries are on the make and can be difficult if tips aren't forthcoming.
Immigration at Heathrow can't seem to distinguish between third world arrivals who are likely to overstay and first world arrivals who won't. A 19 year old from Bangladesh is a potential illegal and needs the full questioning regime concerning return ticket/funds/reason for visit. A middle aged Australian with a passport full of stamps doesn't and its time that was explained to some of those at the immigration desks.
For outright miserable, rude and sarcastic you would need to go a long way to beat the U.S. Immigration and Naturalisation Service.