There are various shades of illegal and not, and it more or less depends what a government wants to do.
In general the WTO and agreements thereof allow free trade between all members (Brazil has been one for decades, and its previous incarnation even longer still). To that end official vendors/purchases might not be able to sell their stock to Brazil depending upon the trade agreements they have with Nintendo, however any random person can buy all the Switches they want in the US, put them on a plane and sell them over there. For the US the law in question is called the first sale doctrine
https://www.nolo.com/legal-encyclopedia/the-first-sale-doctrine.html
Brazil's government then only really has any recourse in import taxes/duties, and if they don't meet local electrical standards (not sure what model Brazil uses offhand -- some places will self certify, others, like the US hence all the "leaks" from FCC testing, have something you send it in and pay to have it tested by a government agency) but I would be shocked if that was the cause -- you tend to only see it with cheap and nasty things from China, not Nvidia/Nintendo flagship products. At the same time Brazil and the US often have a little rivalry of sorts (see why only US citizens got fingerprinted when everybody else can wander on through with a conventional check) so if they decided to do a little trade war then it is a possibility.
It can also be harder to get a warranty repair/replacement done, though most people in such a scenario either accept their losses or ship it to a friend in the US (or Europe or Australia or Japan if it came from one of those) to have them do it for them.
At times the US can also embargo countries for weapons (various consoles have been theoretically suited to sticking chips on missiles and what have you, or so the claim goes), though this is usually more middle east and failed states. For the US to embargo Brazil for game consoles would be a radical step in geopolitics, especially ones that are essentially phones. Same for Brazil blockading imports of things.
Grey market is generally a term because it is not official, but at the same time it is not illegal (which would be black market) so we have grey. Nintendo occasionally likes to have a little whine about such things, and Sony have done worse (I do have to remind everybody about the fate of electricbirdland at Sony's hands).
If Nintendo file a trademark then they can possibly cause some trouble there in terms of words being used (to say nothing of general bigger wallet lawsuit) but not the act of selling in general.