Well sure, if Brazil wants to build the Great Firewall of Brazil, they can do so.
Also, they don’t need a firewall, ISPs can block domain names (which the courts can force them to since they operate in the country) very easily and is used across the world.
Of course when a company is trying to do business in a country, it needs relationships with local companies, access to banking and payment infrastructure, etc... and governments can certainly prevent those from doing business with it. It doesn't sound like that's the issue here though.
If there is a mechanism by which the government of Brazil can force a company based in the USA or Canada to block visitors to its website, I would like to know the details so I can advocate that the USA withdraw from the relevant treaty. I'd apply the same logic to the USA trying to force foreign websites to shut down or block visitors from the USA.
This happens all the time in every country.
It is different in terms of enforcement for someone running a server in their apartment and a corporation. And it depends on the law broken. If you’re running a piracy server in Haiti, the US government can decide they want to shut you down. But if it’s something minor, the government will just ignore you. Companies are different because they’re easier to target when it comes to enforcement.