I'll summarize the other answers. Apple is only obligated under the warranty to provide service in the country of purchase, with the exception that the EU counts as one "country." From the warranty:
IMPORTANT RESTRICTION FOR iPHONE, iPAD AND APPLE TV SERVICE.
Apple may restrict warranty service for iPhone, iPad and Apple TV to the country where Apple or its Authorized Distributors originally sold the device.
Actual experience from users have found that for the most part Apple service facilities will refuse to service phones purchased in other countries. There are occasional exceptions, but it isn't something that you should count on. It can also depend on what service is required; a screen replacement is more likely to be done than other types of service, for example. A key reason is that Apple does not repair phones, except for screens and batteries. They replace them with new or refurbished phones and send yours to a central repair facility. As there are different models for different geographies, a store in a different country generally will not have the model that you purchased in a different country and thus will not be able to replace it with the same model. There are also regulatory reasons; different countries have different certification standards, and a phone that is certified in one country may not be in a different country.