wp_insert_term in a multisite installation

I am not sure how you are activating theme on Network but here I am considering a case of installing fresh theme on a existing Network.

Activating theme on any single site will insert the term for every site in Network but yes of course taxonomy registration code should be there already.

Consider this example

function after_switch_theme_callback() {
    $blogs = wp_get_sites(); //Array of site Ids
    foreach ($blogs as $blog) {
        if (!empty($blog['blog_id'])) {
            switch_to_blog($blog['blog_id']);
            wp_insert_term('myTerm '.$blog['blog_id'], 'genre');
            restore_current_blog();
        }
    }
}
add_action('after_switch_theme', 'after_switch_theme_callback');

It seems to me working fine.

Note:

Register your taxonomy on init action so later terms can be inserted
on after_switch_theme action.