Most db servers don't allow remote access. But if your server does allow remote access then yes, you can import cross-server. But normally you would restore a backup of the database locally (on the same server as XF) and import from that.
While you could technically do a remote import; I've only known 2 sites who have done it successfully. I didn't exactly have that in mind when tweaking code. It can be done, but it also depends on how well the 2 servers communicate. Normally I've found such things time out (reasons for that vary host to host).
Of course if the 2 domains are on the same server; this is not a problem at all (it's still localhost)