I want to customize the_posts_navigation function by replacing prev and next with images

You can put svg text right in the prev_text and next_text.

To make it a little more readable here I’ve broken it up and prepared the SVG markup first. I am only show you the “prev” link but the “next” would work the same way.

$prev_label = "<span class="cover--nav-label">" . _e('Recette précédente', 'marque') . "</span>";

$prev_arrow = "<svg class="icon icon-arrow-prev" role="presentation" focusable="false"><use xlink:href="" . get_template_directory_uri() . "/images/symbol-defs.svg#icon-arrow-prev"></use></svg>";

$prev_text = $prev_label . $prev_arrow;

the_post_navigation( array(
  'prev_text' => $prev_text
) );

Note that the_post_navigation will be wrapping your prev_text (and next_text) within the tag and applying the appropriate link target, so you don’t include that part here.