iOS and macOS have context menu items which allow a user to search online for the selected text (Search Web or Search with <Search Engine>). There’s an additional search entry point in the macOS menubar under <Application Name> -> Services. Clicking on any of these performs the search in Safari regardless of the default browser.
All built-in applications and affordances that open external links should open them in the user’s default browser.