Can Your Nintendo Switch Actually Get A Virus?
The idea of a game console getting some kind of virus seems inherently far-fetched. It's just a game console, right? It's not like there's anything valuable on there, like the sort of personal information you could get off a mobile phone or PC. But it pays to remember that, as consoles have incorporated more internet connectivity over the years, they, too, have become more susceptible to bad actors around the internet.
Even a console as innocuous as a Nintendo Switch could have some information that a hacker might want to get their mitts on, with stored eShop payment information being a prime candidate. The vital question, then, is whether or not it's realistically possible for a Nintendo Switch console to get a virus that could compromise its functions and steal your information. The answer to that question depends heavily on what you're using your Nintendo Switch for.
The answer's yes, but you don't have to worry
In the broadest terms, it is technically possible for a Nintendo Switch console to get a virus. It is a computer, and it is connected to the internet, and as with any other internet-connected device, a virus could get at it, at least in the most literal sense.
However, the notion of making a Switch-attacking virus would be generally unappealing for hackers for a handful of reasons. First and foremost, the Switch doesn't have a standalone internet browser app. The easiest way to get a virus is to visit a compromised website, but that's not an option. The only way to get software on a Switch that isn't made by Nintendo is through game or app software.
This leads us to the second reason: eShop security. While there is no shortage of miscellaneous junk games on the Switch eShop, none of those games are outright malicious. This is because every game that tries to get listed on the eShop is vetted by Nintendo's security team. Unless a hacker makes an extremely advanced virus, it'd be caught and blocked in a heartbeat. Even in such a circumstance, the hacker would need to spread the word about their infected app and convince people to download it, which would require quite a bit of effort in its own right.
So, in summation, while your Switch could get a virus, its ecosystem is so isolated that the pursuit just isn't worth it.
The big catch
While your Switch is protected from viruses and bad actors by Nintendo's built-in defenses, that's predicated on the assumption that you're using your Switch with vanilla software. If you attempt to modify or jailbreak your Switch, that may open up a much simpler avenue for hackers to get their feet in your door.
While jailbreaking your Switch in itself won't endanger it (though it will void the warranty), jailbreaking usually isn't undertaken unless you intend to download unverified files like external utilities or pirated games. Bad actors make a sport of injecting pirated game files with malicious code that can steal information or brick your Switch completely. If a utility or game that requires your Switch to be jailbroken sounds too good to be true, it almost definitely is.
The only saving grace here is that any potential viruses would need to be made with the Switch's framework in mind, so a hypothetical virus would need to be crafted explicitly for the Switch rather than recycled from a PC. Even so, that's a big gamble and generally one not worth taking.
As long as you keep your Switch in its proper state, you shouldn't need to worry about viral attacks. But if you choose to disregard the console's security features, you shouldn't really be surprised when something bad happens.