A firewall is something you should be running simply because your plugged into a network not specifically due to using chat applications.
You've first got to define what they're trying to hack into: is it your local files which you are worried about, the chat conversation itself or other network communication using the same interface.
To keep your local machine secure you should use a reputable chat application and protocol as there's no way of knowing if an unknown protocol or application will allow injection or include a backdoor. This is of course on top of the standard security strategies (firewall, least privilege ect).
As for the conversation you need to use encryption like SSL for transmission. The server should use truecrypt full drive encryption (this way if the machine is physically seized the data is useless), be secured with good passwords and firewalls and preferably have all logging disabled (just in case).
As for securing other network communication or meta-data about your communication (who's connected, number of users ect) you should be looking at proxies and systems like tor. If you're using private proxies then these should obviously not be under your name and should exploit laws and diplomatic difficulties between nations (ie authorities in Russia are unlikely to cooperate with US authorities unless it's in Russia's interest)