How to add “get_theme_mod” inside a shortcode?

I would comment, but lack the pointage…
You seem to be on the right track:

I see that your shortcode callback and the function are named
differently: (f_gallery_shortcode / function_gallery_shortcode).

Try this:

add_shortcode( 'ui_gallery','function_gallery_shortcode' );
function function_gallery_shortcode(){
    $dynamic_h1 = "<h1>" . get_theme_mod('dynamich1') . "</h1>";
    return $dynamic_h1;
}

now using [ui_gallery] in your posts, should return the results of your Customizer value <h1>dymanich1</h1>