There are pros and cons for both but the most sustainable option is of cause hand sanitizer because you can recycle the bottle after use and the gloves are disposable and will go directly into landfill.
Remember when you are using gloves, what you touch, you will carry around with you. Imagine a cashier that has touched something that has the virus. The cashier will continually transmit the virus between each customer if they wear the same pair of gloves compared to sanitize their hands between each customer.