Is there a way to test if a URL is part of the current blog?

One option could be to use url_to_postid( $url ), which returns a “ID of the post or page that resides at the given URL, or 0 on failure.“, https://codex.wordpress.org/Function_Reference/url_to_postid

But this doesn’t work with archives, I think. To find out if the url is for an archive, you’d probably need to explode() the path and then do some kind of get_term_by() with the parts.

Perhaps a little less strict way would be to compare the url’s host to your domain,

if ( false !== strpos( get_home_url(), parse_url( $some_url, PHP_URL_HOST ) ) ) {
  // do something
}

or

if ( parse_url( $some_url, PHP_URL_HOST ) === parse_url( get_home_url(), PHP_URL_HOST ) ) {
  // do something
}

But doing it this way, you wouldn’t know, if the path was correct or not.