Whether or not a customer can get cash back when returning an item that was purchased using a debit card depends on the specific store's policy. There are some stores that refund the purchase in cash, while others put the refund back on the card.
One thing that can affect whether or not a customer is given cash is how the transaction was recorded. If the customer entered their PIN number, the store may be more likely to give the refund as cash. If the purchase was done as a credit card, then the store may be required to refund the purchase back to the card.