Yes it is possible to have multiple versions of .NET installed on a web server.
You can run multiple applications in IIS on different frameworks.
However an application can only use ONE framework. As a virtual directory is part of the application it runs under the application's framework. E.g. Application (.NET 2.0), it's Virtual Directories are CHILDREN of it, so they are running under .NET 2.0.
Further details on IIS, Applications and Virtual Directories
The solution would be to run 2 applications, one for 2.0 and one for 4.0.
Luckily, in IIS, there is a method to convert a Virtual Directory into a Virtual Application, which gives you the opportunity to use a different Application Pool, and therefore different framework version.
I'm going to recommend you read this StackOverflow post, that is far more eloquent then mine.
StackOverFlow - difference between application and virtual directory