Just a year ago Musk was happily complying with censorship orders in Turkey [1] and [2]
In Brasil's case he decided to abruptly pull out if the country.
[1] https://arstechnica.com/tech-policy/2023/05/musk-defends-ena...
[2] https://theintercept.com/2023/03/28/twitter-modi-india-punja...