Absolutely. You can write applications that will run on any
J2EE-compatible application server. Although a few cases are very
difficult, in many cases more can be done than you may realize. Java
BluePrints (http://java.sun.com/blueprints) is the proof point here.
Each year, we run the Deployathon
(http://java.sun.com/developer/technicalArticles/J2EE/deployathon4/)
which demonstrates a significant J2EE application running on multiple
J2EE-compatible application servers.