Adding a class to the body of an inactive site using multisite

Yes, you can use the body_class filter. If all the sites use the same theme, you can get away with putting this in functions.php (in a child theme so your code doesn’t get overwritten when the theme is updated), but if any sites have a different theme, you’ll need to put it into a custom plugin (perhaps a MU plugin).

<?php
add_filter('body_class', 'wpse_299000_body_class');
function wpse_299000_body_class() {
    // check if current subsite is inactive, deleted, archived, or spammed
    $is_inactive = ms_site_check();
    // value will come back either true or false
    if($is_inactive == true) {
        // add your desired class to <body> - this example adds .inactive
        $classes[] = 'inactive';
    }
    // always return classes so none are taken away
    return $classes;
}
?>

You can also remove classes if needed.