As for SMS texts, they could be backed up at least on later Symbian OSs, with the Nokia Ovi desktop app. On Android, backup apps would be able to do it as well.
At least in theory, EU directives for data portability (the "takeout" feature) should grant access to the message history for any abiding platform.
I think all chat platforms should have the decency to offer an export option, regardless of the underlying protocol.
Recollecting my message history from all sources into a common database is definitely high up in my project backlog.
It's a wild throwback. Even though it is mostly mindless chatter, it is nice to have.
It's definitely a shame that there was no common/interoperable format for locally stored IM history, like there is with emails.
What I mean is: your chat partners could archive your chats or some man in the middle. Better to know what you wrote, then to be blindsided later by somebody else who got hold of these archives.