get_body_class() in ajax envrionment

You are probably trying to do something wrong. Templating functions require context with global query and post variables properly set, and even then you might miss all kinds of filters because ajax requests are not being run in the context of template evaluation which means that template_redirect, wp_head and others are not being “run” which in turn might impact which filters are being applied to the body and post class generation.

If you do not need to be plugin compatible, you can just set the global enviroment, but I have a feeling that in such a restricted enviroment you might know the classes at the JS side without any need of sending an AJAX request for that.