How to get the full URL of the current page and change domain of it?

If it’s a page or post, then you can get its url with get_permalink().

And to change the domain, you can do some simple string replacing with str_replace.

So here’s the code:

echo str_replace( 'OLD_DOMAIN', 'NEW DOMAIN', get_permalink() );