Yes you can have SQL Server 2005 and SQL Server 2008 on the same server.
One will need to be the default instance, and one will need to be a named instance.
Default = <servername>
Named Instance = <servername>\<instancename>
Each instance is installed in its own installation directory and has its own port number, 1433 is the port number of the default instance and the named instances will have a random port number assigned at installation.
See the following website for more info on SQL Server instances.
Instance Configuration
http://msdn.microsoft.com/en-us/library/ms143531.aspxTypically you would go with a SQL Server 2005 default instance, and a SQL Server 2008 named instance.