Different versions of .net can coexist on the same server, you must have .net 4.0 installed on the server and the app pool for the site must be set to use it, if you are using a host provider this is normally be set in the control panel.
Yes, they can be installed on the same server, but they don’t run in parallel on the same site/ app pool, you have to select the .net version in the app pool setting.
You might want to google "app pool" for more information about it.