How would I unlock an iPhone while out of the country?
iPhone unlock is a remote process done by your carrier directly with Apple.

From Apple Support:

After your carrier confirms that your iPhone unlock has been processed (…)

If you have a SIM card from a carrier other than your current carrier, follow these steps:


Remove your SIM card and insert the new SIM card.
Complete the setup process.


If you don't have another SIM card you can use, follow these steps to complete the process:


Back up your iPhone.
When you have a backup, erase your iPhone.
Restore your iPhone from the backup you just made.


It does not mention anything on having to be on an area covered by your original carrier, but the process apparently needs internet.


  (…) contacts the registration database (…) to determine the lock status and set the appropriate carrier settings file if needed.


See this question for additional information.