Great question Vincent!
The iPhone itself, and any of it's running applications (such as CocoaHTTPServer, etc) will have no problems accepting incoming connections… in and of themselves. However, they are at the mercy of whatever network they are attached to.
The primary problem is NAT (network address translation). NAT is used in most every off-the-shelve WiFi router. So what does NAT do?
For a full description I'll point you to wikipedia:
But an overly brief description is this:
It won't allow any incoming packets unless the NAT device has recently seen outgoing packets to the IP:port in question.
Long story short: This works good for client applications (making HTTP requests, asking a server for your email, etc). But for server applications… you're kinda hosed sometimes.