Yes. It works in just the same way as a credit card for this type of payment, and the good news is that the surcharge added by some merchants (e.g. government departments) is usually lower for a debit card than it is for a credit card.