This problem was solved with XMPP/Jabber. Facebook and Google used to use it for their chat clients. You used to be able to use Google Talk to talk with other servers, but after a while they removed that, and then killed Google Talk. Facebook messenger used to have an XMPP-compatible API, but could never talk to other servers.
I don't know why more messaging services use XMPP to bootstrap their userbase. It would allow you to switch to a new service, while you could still talk to your friends that haven't moved yet.