Here is how to add custom classes in jQuery UI Dialog (Version 1.8+):
$('#foo').dialog({
'buttons' : {
'cancel' : {
priority: 'secondary', class: 'foo bar baz', click: function() {
...
},
},
}
});