yes and no. You cannot do it from the GUI, but you can access the firewall (ipfw) from terminal and add rules there to do whatever you want. I won't even go there, except to say that ipfw is the program you use from terminal...take a poke around google and read the man page about 100 times.
If you are worried about 'outbound' connections, then Little Snitch is fantastic and inexpensive (shareware.)