Which law? No law says that. Also worth to notice that X closed it's office and fired everyone in Brazil because they threatened to arrest its employees which is absurd considering they have no administrative authority or technical capability to comply with those orders.
The law says that you need legal representation to be able to do business in Brazil. To sign contracts and pay taxes. Twitter no longer does business (i.e. doesn't sell ads) in Brazil. Twitter fired everyone and left Brazil a few weeks ago.
Twitter is now like Hacker News. A billion-dollar American company (Y) that hosts user-created content, free to be used by anyone on the global Internet.
Hacker News/Y does not need legal representation in Brazil.