Yes it is possible. First initialize your pubnub using PUBNUB.init() method if you don't use a div for your setup credentials. Then you can make an AJAX request to your server to obtain the channel name. After obtaining the channel name, just subscribe to it via the pubnub subscribe() call. You can subscribe to a PubNub channel at any time.
Assuming your server will respond to your request with text datatype:
var pubnub = PUBNUB.init({'publish_key':'demo','subscribe_key':'demo'});
pubnub.ready();
$.ajax({
url :'http://example.com/getchannel',
type :'GET',
dataType :'text',
success : function(data) {
pubnub.subscribe({
channel : data,
message : function(m) { console.log('new message received: ',m);
});
}
});