While the technically correct answer is yes, iPhones (and iPod touches and iPads, since they run the same operating system) can get viruses, the likelihood of that happening (at least right now) is extremely low. There have only been a few iPhone viruses created and most were created by security researchers and haven't been released on the Internet.
Of the iPhone viruses that are "in the wild," there are worms, a kind of virus, that almost exclusively attack iPhones that have been jailbroken. So, as long as you haven't jailbroken your device, your iPhone, iPod touch, or iPad should be safe from viruses.
But Should I Get iPhone Virus Protection To Be Safe?
The answer, for now at least, is no. There aren't any identified iPhone viruses in the wild--there have only been proof-of-concept viruses and attacks.
As you can see, deciding whether you need iPhone virus protection depends on what you do with your phone. Another way to answer the question, though, is based on what antivirus software is available for the iPhone. Turns out, not much.
There aren’t any antivirus programs at the App Store as of Oct. 2011 (the ones that carry that name are games or tools to scan attachments for viruses that couldn't infect the iOS anyway). McAfee, a leading antivirus company, has developed an internal app, but hasn't released it. Trend Micro, another security company, offers a secure browsing app (Download at iTunes), but that’s not specifically for antivirus. Symantec doesn't offer an antivirus tool.
If there was a real need for iPod touch, iPad, or iPhone virus protection right now, you can be sure the big security companies would be offering products for it.
Got a tech support question? Ask it in the discussion forums.
Want tips like this delivered to your inbox every week? Subscribe to the free weekly iPhone/iPod email newsletter.