If bought directly from Apple, online or in a Physical Apple Store, the iPhone is unlocked, and will work in India. Apple sells unlocked iPhones directly.
If bought from anywhere else, it will likely require it be set up with a US carrier first and will lock to that carrier. Only the carrier it is locked to can unlock it. Link-> How to unlock your iPhone for use with a different carrier - Apple Support
Do note, warranty may only be valid in the US. Apple does not take international shipments for warranty service, so you will need to get it back to the US and then take it in to an Apple Store if it ever needs service.