How to add custom taxonomy to search

You could try unsetting the original search query, otherwise you may be doubling up and the combination results in nothing? eg, try adding to your function:

$query->set('s','');

UPDATE

I am not sure on this one, but you could try the AND operator -I think this adds to the existing query instead of replacing it…

function mytheme_pre_get_posts( $query ) {
    if ( !is_admin() && $query->is_search() && $query->is_main_query() ) {
        $term = get_term_by('name', get_query_var('s'), 'cars');
        if ($term) {
            $query->set( 'tax_query', array(
                 array(
                    'taxonomy' => 'cars',
                    'field'    => 'slug',
                    'terms'    =>  $term->slug,
                    'operator' => 'AND'
                )
            ));
         }
    }
}
add_action( 'pre_get_posts', 'mytheme_pre_get_posts', 1 );

Note: changed use of field name as mentioned by @PieterGoosen to slug, and pre-fetched term slug to pass to tax query, and extra conditions as mentioned by @birgire.