Yes, if you overpay then you go back in and get the change back. If I give the cashier a twenty, but only pump $10 worth, then I get $10 back from them. Most people are pretty good at estimating it though, so generally the people that pay in cash will just leave the few dozen cents they didn't use.
I actually didn't realize pay-first for cash transactions had become the standard until recently as I made the swap shortly after 'pay at the pump' became common and never really looked back. How does it work? You just estimate how much you need, and the pump cuts off at that point? If you can't hold that much you go back for a refund?