I've never seen DCC offered at an ATM, now that I think of it - just at hotels and retailers. But then again, I generally try to steer clear of non-bank ATMs, as they tend to be sketchier. Is this something that banks will do to their own machines, or is it just the third-party vendors?
I was last in Spain a couple of times in 2018, but I didn't have this issue. Then again, I don't think I actually used a credit card more than twice at a restaurant or retailer, as I generally take cash out at the ATM and then pay for everything with that cash (just a personal trick I use to better control my spending). I know when I was in Iceland in late 2017 I bought a wool blanket at a tourist shop in Reykjavik, and the terminal there offered DCC, but the guy kindly recommended against it upfront.
This isn't exactly DCC, but one thing I have seen is hotels that quote you a rate and charge your credit card in USD, even if that isn't the country's local currency. I had this happen in Uruguay and Israel - the hotel would list its rate as USD60 or whatever, the charge slip would be in USD, and the transaction would hit my card in USD for the exact same amount. So there was nothing underhanded - they just had a parallel currency system for those transactions.
Now that I think of it, in 2019 I was in Israel, flying back from TLV, and stopped into a duty-free shop at the airport to buy some chocolates to take to my office the next day. They had two prices posted, one in shekels and one in USD, and (thinking this was a DCC issue), I specifically asked to be charged in shekels. Then when the transaction hit my CSP card and it was converted, it ended up costing me like 60 cents more than the posted price in USD