Yes, you can block P2P & IM and such by the apps default port numbers within a firewall. But, the developers of these apps are deliberately making these apps evasive and sneaky with the intent to go through firewalls. Common techniques to circumvent port blocking is to tunnel P2P & IM data within common ports such as 80 and 25. Who will close port 25 when running a mail server? P2P apps also use encrytion to make identification difficult. Skype is the most evasive and difficult app to stop to date. For example, Skype uses a https request in its preamble on the basis that most firewalls will allow https request. Why should we block Skype some say? Well its an undocumented protocol, closed protocol and can consume lots of bandwidth when running as a supernode. Also, the file transfer bit cuts right through most firewalls and therefore is a major security threat. Plus, who really knows apart from Skype development team what the program is really doing?
Other techniques include tunneling to external proxies and there are several companies offering a commercial service specifically to evade firewalls and security. Hopster is one service.
Preventing P2P and apps that are deliverately evasive is not easy and several P2P apps such as the new version of BitComet openly brag about evading certain expensive brand solutions - Packeteer. Also, as I mentioned in earlier post chat channels are now distributing lists for sharing files via bots.
It all makes securing an internet connection interesting and there's always something new to learn.