Basically the restaurant would put a notice at the entrance to inform the customer XX minutes before closing time to stop taking orders. Normally it is 30 minutes before closing. Or if you go into the restaurant, the waiter informs you we are to stop taking orders from now, then you should not dine at the restaurant, but if you insist on dining in, then it is considered rude.
The important point is if the waiter lets you come into the restaurant, sit down and is willing to take your order, then that should be ok and not considered rude. That means the restaurant is ok to do business with you. If a restaurant is not willing to serve your dining in, then they should have told you they are stopping taking orders, that’s simple!
But just be considerate, because one hour before closing is considered short, you are advisable to linger too long after finishing your meal, and consider tipping a little extra to show your appreciation for the staff’s accommodation.