It is usually an option in your bank's app. It depends on the bank though, obviously. If it's not there, you have to be vigilant while using your card (always select the local currency when given the option).
I don’t know a single bank in Europe that provides this option
Edit: Perplexity says this:
> cards cannot block DCC offers because the merchant terminal identifies your card’s country of origin from the card number and offers DCC accordingly. Always manually decline at payment to let the card handle conversion at better rates
I checked and it doesn't look like any UK banks have this option - at least I looked at about 5 different banks websites and all have pages suggesting you always select to pay in local currency but none of them have any information on disabling this behaviour
Gemini confirms it's not a thing, and not really possible (the terminals just detect the country from the card number)