The big exception that I know of is that much of the rest of the world is a little more relaxed about cockpit visits in flight; people may have bent the rules a little in the pre-9/11 days but it's actually been a really long time since non-crew were allowed on the flight deck officially on U.S.- flagged airlines at all.
It would still take a bit of luck but in theory you would have a fair chance while traveling outside the USA. I had a lot of luck getting cockpit visits and even a full-length jumpseat ride across Switzerland traveling non-rev in Europe back in the '90s. that was pretty cool.