• Server you want to ping must have public IP and dns records.

    You must have access trough firewalls.

    This should be enough for ping to work.

    Other option is to have VPN connection between two different networks. I think this is better and more common way to do this.