Are grocery store cashiers allowed to accept tips like in a restaurant?

Female Cashier in a grocery store where I live admits she's underpaid at her job. She looks for a tip from her customers after paying their groceries so she can save up to buy a chocolate bar, something inexpensive. Uh, are cashiers allowed to accept tips? Like, isn't giving tips something you do in a restaurant, cab ride, or barbershop?
Are grocery store cashiers allowed to accept tips like in a restaurant?
Post Opinion