Separately to what I have written above, under ICAO every State has a right to demand that a pilot landing in its airspace meets its medical requirements. I don't have a ref but I remember who posted one here a while ago.
This is rarely invoked for obvious practical reasons (like making international aviation grind to a halt) but I believe (it is a year or two since I had the details of an actual case) the UK CAA have used it to ground one or two pilots who had a bit of a "history" in various departments.