Neither Sony nor Nintendo will be exiting the console business any time soon, but I could entertain the idea of Nintendo leaving first if only because Nintendo has reinvented itself before and Playstation is Sony's most profitable branch of business in the entire company by far.
Nah, Nintendo could find great success elsewhere but I doubt there is anything that would be successful enough to make them drop their video game business. Their IPs are strong enough (especially in gaming) that they'd need to just reinvent their hardware business and reinvent their games before reinventing their entire brand.
It would be like Disney leaving animation, it's just not going to happen, regardless of their their success elsewhere.
If Playstation stumbled as a brand again and Sony found other more profitable ventures, Sony would leave before Nintendo.
Games are the core of Nintendo's business and they have tons of value in their IPs and in cash which gives them more options than people give them credit for. Sony on their other hand is all-in with gaming because all their other ventures have failed; once very lucrative and industry-leading ventures.
If Nintendo stumbles they refocus their efforts in gaming while trying to expand in other ways. If Sony stumbles with Playstation, they likely aren't going to scrap much of their multimedia and electronics holdings (which still gives them synergistic holds where one sector can prop up another), even if they are struggling and I can't see them pulling most of their eggs into the Playstation basket if things got that rocky because they could lose their lead at any moment, like with the PS3.
Sure, the PS4 could be a good strategy for Sony across the board, but the Vita was a money pit and the combo of the PS4 Slim, PS4, and PS4 Plus could mean cannibalizing of SKUs, plus we don't know if PSVR will sputter to a halt out the gate or not and Sony has a lot of money tied up in it's success.