The answer is never. It's NEVER ok to be rude to anyone, let alone to people in the foodservice industry who are trying to help you.
As someone who has worked multiple jobs in a restaurant and who frequents Starbucks, I've noticed that people can be very rude to those helping them. But you should never be rude to your server, barista, cashier, or food runner - even in these 6 frustrating scenarios.
When you're in a bad mood?
No.
If your order gets messed up?
They're human. HUMANS MAKE MISTAKES.
When the restaurant/store is busy?
There are only two Starbucks locations on a campus of 20,000 people. Of course it's going to be busy!
When they ask for clarification on a complicated order?
They're just trying to make sure that you won't get upset when the order is possibly wrong (see No. 2).
P.S. If you order an extremely complicated drink that doesn't exist, you really can't get mad when they ask for clarification.
When you're short on time and know you'll be late to class?
Everyone knows that the line takes a while. Plan accordingly—it's not the barista's fault if you don't.
When they get a little frazzled if it gets busy?
Once again, they're human. And if they weren't working there and putting up with the crowd, you couldn't get your trenta latte macchiato with light ice and skim milk.
Just remember, the people who work in foodservice are only human, and they're trying their best. So just be a nice human!
And one more time: when is it OK to be rude to them? Never!