skytrax
Seconded -my outfit has a strictly no pax visits whilst the engines are running rule - and there are no exceptions.
Voeni
In most places the Captain does not have the flexibility you imply- Flight Deck access rules are generally laid down at Government level ( well certainly in the UK) and anyone permitting such a visit would probably pretty soon find himself/herself out of a job.