Will an iPhone work and still have regular warranty if it's bought outside your country?
If your country has an official Apple store, then yes (warranty covers) but it will not be valid if your country has only the official Apple Reseller store. 

You must have a proper purchase bill and verify that you own that hardware, then Apple Store will take care of it. In my case, I had purchased my iPhone in Finland and I was able to get a warranty here in Spain too. 

Offical statement from Apple:

No Apple reseller, agent, or employee is authorized to make any modification, extension, or addition to this Warranty. If any term is held to be illegal or unenforceable, the legality or enforceability of the remaining terms shall not be affected or impaired. This Warranty is governed by and construed under the laws of the country in which the Apple Product purchase took place. Apple or its successor in title is the warrantor under this Warranty.

Detail on it: https://www.apple.com/legal/warranty/products/ios-warranty-document-us.html