Miners could in theory decide to blacklist transactions from particular addresses which are pseudoanonymous. It's a harder coordination problem because miners are less geographically concentrated since the mining ban in China [0] but it's not inconceivable for a country to restrict mining in that way though which would pretty quickly restrict your ability to get transactions included successfully because you'd have a double gamble first on a non-restricted miner including you then on being included on their block (which you could increase by overpaying transaction fees).
[0] https://www.visualcapitalist.com/after-chinas-crypto-ban-who...