The installer for Xcode 3.x fails when you try to run the installer against Lion.
Xcode 4.0 also does not work under Lion, and purposely refuses to start.
Some Developer applications (like Dashcode) do start but more often than not just crash.
If you really depend on Xcode 3 your best bet is to keep Snow Leopard on a second partition alongside Lion and dual boot when needed. AFAIK you can nonetheless target previous Mac OS X and iOS versions to some extend in Xcode 4.1.
You can try installing it on Snow Leopard and then upgrading to Lion - that's the best chance, but it might be easier to keep an external disk bootable with Snow Leopard and Xcode 3.x just in case you run into any glitches down the road.