So, the president of the USA should not be allowed to visit the cockpit on Airforce 1.
Airforce 1 is not a commercial aircraft and thus not bound by these rules, so the President can do what he likes.
In the UK or on the UK reg, the answer should have been no. If the PM or his friends want to sit on jumpseats then they can buy their own aircraft, they're rich enough!