I think, as a general rule, any priest who refuses to hear a Confession at any time should re-think his vocation.
A priest should hear a Confession at any time unless there is a very good reason, such as the next Mass starting in three minutes and he’s the celebrant.
Unless the priest knows the person, what if the man or woman asking has just gotten up the nerve to ask after listening to an inspiring homily, and he or she has been away from Confession for a long time? If the priest refuses, it may lead to a lost opportunity of grace for the individual.
If the priest does know the person, then I think it’s more acceptable to ask if it can wait until this afternoon/tomorrow/etc. but then only if the priest has a legitimate excuse such as needing to leave immediately to give someone last rights. (Needing a cigarette is not a legitimate excuse.)
That being said, I don’t think this gives anyone carte blance to ring a rectory bell at midnight!