If it's locked, you will need an active SIM card from the carrier it is locked to in order to complete the initial activation and make it to the home screen (with all the app icons), then you can remove the SIM Card. In this scenario, if you ever erase the iPhone or restore it or complete a major update, you will need to repeat the process.
If the iPhone is unlocked by the carrier through Apple (fully unlocked, not just flashed) then you can activate without a SIM and use it as an iPod Touch with no issues.
It all depends on the carrier it's locked to. If you insert a SIM card from another carrier into a locked iPhone, it will not work for cellular service or activate if you have to complete the set up or update screen again in the future.
Here's more info:
iPhone: About unlocking
You can unlock your iPhone for use with different carriers.
Start the process to unlock your iPhone:
- See if your carrier offers unlocking. Only your carrier can unlock your iPhone.
- Contact your carrier and request an unlock. You might need to meet requirements to qualify for unlocking. After your carrier submits the unlocking request, it may take up to seven days.
- After your carrier confirms that your iPhone unlock has been processed, go to the next section.
If you have a SIM card from a different carrier than your current carrier and your current carrier confirmed that your iPhone is unlocked, 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:
If you experience issues or see the following message in iTunes or on your device, follow the steps below:"The SIM card inserted in this iPhone does not appear to be supported. Only compatible SIM cards from a supported carrier may be used to activate iPhone. Please insert the SIM card that came with your iPhone or visit a supported carrier store."