WordPress Tag or Custom Taxonomy Return All Posts if has that Word in Post Title

You can check if you are on a tag page with a conditional, and then modify the main query:

add_action( 'pre_get_posts', 'search_the_title', 1 );
function search_the_title($query){
    // Check if it's the main query
    if ( $query->is_main_query() && !is_admin()) {
        // If it's a tag page, search posts by tag
        if ( is_tag() ) { 
            $query->set('s' , get_query_var('tag' , ''));
            // Unset the current tag to search all posts
            unset( $query->query['tag'] );
            return;
        }
        // If it's a taxonomy page, search by taxonomy value
        if ( is_tax('topic') ){
            $query->set('s' , get_query_var('topic' , ''));
            // Unset the current taxonomy to search all posts
            unset( $query->query['tax_query'] );
            return;
        }
    }
}