Is it possible or/and how to restrict access to the block on th certain page using route name? I am trying to restrict access to the block to be accessible only on the route:entity.user.canonical route.

Is it possible to define that on the block edit form?
There is no UI for it, but you can either write your own condition plugin to do that or implement hook_block_access() like this:

function yourmodule_user_block_access(BlockInterface $block, $operation, AccountInterface $account) {

  $hidden_blocks = ['yourtheme_block_id'];
  $hidden_routes = ['entity.user.canonical'];

  if ($operation == 'view' &amp;&amp; in_array($block-&gt;id(), $hidden_blocks) &amp;&amp; in_array(\Drupal::routeMatch()-&gt;getRouteName(), $hidden_routes)) {
    return AccessResult::forbidden();
  }
}