Yes it is possible. You can make GetCapabilities request to WMS server, parse result with OpenLayers.Format.WMSCapabilities(), and you'll get list of layers and lot of other useful information.
UPDATE: here is sample code. I suggest, that you console.log() response and examine it with some developer tool (like FireBug). It's easy to find list of layers.
NB! This is GET query and, because of same origin policy, you need to set up proxyhost to get it work.
var wmsCapabilitiesFormat = new OpenLayers.Format.WMSCapabilities();
var onLayerLoadError = function() { /* Display error message, etc */ }
...
OpenLayers.Request.GET({
url : yourWMSUrl,
params : {
SERVICE: 'WMS',
VERSION: yourWMSVersion, // For example, '1.1.1'
REQUEST: 'GetCapabilities'
},
success: function(r){
var doc = r.responseXML;
if (!doc || !doc.documentElement) {
doc = r.responseText;
}
var c = wmsCapabilitiesFormat.read(doc);
if (!c || !c.capability) {
onLayerLoadError();
return;
}
// Here is result, do whatever you want with it
console.log(c);
},
failure : function(r) {
onLayerLoadError();
}
});