Yes, seen it happen but you can often talk your way out of it, or print a fake bus ticket. Other times you'll be less lucky, it really depends on how you get on the desk.
Technically its the law in a lot of countries but often not enforced.. up to you whether its worth the risk!