To add to the previous answers, one can use any port as long as it is not already in use (although, for various reasons, ports below 1024 should be used only with caution).
The ports in use depend very much upon what is running on the machine - to find out what ports are in use, try running one of the following at a command prompt:
netstat -tan on Linux
or
netstat -qnp tcp on Windows
The column headed Local Address contains the information that you need - port numbers are after the colon