The answer is yes, it will work. The only difference will be in the way you obtain the Connection Factories from JNDI.
When you obtain a JNDI Initial Context you must specify a URL and a "factory type". If you examine the different examples of JNDI code for looking up
EJB homes for different servers (like in Richard Monson-Haefel's book) you'll see that different vendors have different ways of specifying the URL and the name of the class (a factory) that creates the "initial context".
You'll find the same thing to be true in looking up connection factories, queues and topics for JMS. The way you specify the JNDI initial context will differ slightly. However, this is easily resolved by looking these two parameters up from a properties file.
Kyle