Yes. If you purchase an unlocked iPhone - that is, an iPhone that is not locked to a particular wireless carrier - you can insert the SIM card and it will work in the country where it was sold.
However, until the iPhone 8 is released, there is no way of knowing what you'll be able to do with a SIM card on it.