They could, of course, but they would have to actually build a system that can handle current gen games.
They would also need to learn to play nice with third party studios, and spend more on game development.
I don't think any of those will happen though, they made their choice clear with the switch. They're happy doing handheld gaming and underpowered home consoles, keeping churning out uninspired Yoshi, Kirby or Pokemon games.
And you have to take also the mobile market into account, where they are just doing what everybody else is doing: copying successful concepts and slapping a skin of their own IPs on it.
Nintendo is still able to make some great games, but they really are starting to be the exception in a library full of mediocrity and easy cash grabs. And even if those games are great they still are held back by underpowered hardware and useless gimmicks.
I use to love Nintendo, but at this point, if they stopped making games, I would only miss Zelda and Mario. All the other things I miss about Nintendo has been already gone for a very long time.