Eh, there’s acceptable and there’s acceptable.
The actual rules are, in general, that if you’re there in the restaurant before the listed closing time, you get to order and be served.
If you do that, it’s polite to just get a couple things and not hang around. If they close at 10 and you walked in at 9:59, you probably shouldn’t get appetizers and salads and then main courses and then elaborate desserts after dinner and so forth. But if you wanted to, you would have the right to.
Staff annoyance based on what they thought might happen may or may not be anything you can predict. I’ve worked in a few different places and in most, we didn’t start closing until closing time. If you were, at least, done ordering by close, we were good. We did get a little irritated if it got to be quarter past and you wanted another appetizer or whatever and if it got to the point where we were done cleaning everything in the kitchen and we had nothing left to do except for your table, your glasses, and sweeping and mopping the dining room and you were taking your sweet time just hanging out and gossiping… then we started thinking less-than-kind thoughts about you.
The most recent restaurant where I worked, though, very regularly had no business the last hour or more, so it was not at all unusual for us to walk out five minutes after the posted closing time. It was a whole different type of restaurant, though- more take-out than fine dining. At that place, how late it was “okay” to order depended entirely on things you had pretty much no way of knowing, controlling, or predicting. If we were dead slow and hadn’t seen anyone in two hours, then coming one hour before close might throw a wrench in our gears. Or coming 15 minutes before close might be awesome if we had been going steadily and your order got us closer to running out of food. Ordering chips at the most recent place were a giant pain in the butt because we fried those fresh. At the previous place I worked, chips were about the easiest thing you could order because we ordered them from a company, so serving you chips just meant taking them out of the box and putting them in the bag/bucket/whatever.
My point is… don’t worry too much about it, really. Be conscientious, kind, and thoughtful if you’re there right at close (or anywhere, all the time). Maybe ask, but don’t necessarily expect the servers to be super honest. They know being cheerful is how they get paid. Same as with any business, though: you’re allowed to go there right up until the posted closing time. You might make someone’s life/job a bit harder if you do and it’s up to you if that matters to you. As the customer, as long as you’re generally polite and courteous, it’s okay if it doesn’t. There’s not necessarily a rule that will apply to all restaurants or even one restaurant on all nights, though. Apart from, that is, leave when they close. That’s pretty universal.
That said, I do avoid going places at least a half hour or so before closing. Longer if I plan to sit down.