Way to redirect all Product Sub Category to its Main category Page?

You will have to use JS for the redirection since header is already sent before we can check the category, following snippet would do the work:

add_action('woocommerce_before_main_content','redirect_to_top_level_parent',1);
function redirect_to_top_level_parent(){
    if (is_product_category()){
        $cate = get_queried_object(); $cateID = $cate->term_id;
        $parentcats = get_ancestors($cateID, 'product_cat');
        $count = count($parentcats);
        if ($count > 0){
            $count = $count-1;
            $link = get_term_link( $parentcats[$count], 'product_cat' );
            $redirect = "<script>";
            $redirect .= "window.location.replace('{$link}');";
            $redirect .= "</script>";
            echo $redirect;
        }
    }
}