According to w3.org, the H1 should be the most important heading on the page, but it doesn't have to necessarily be the first heading:
https://www.w3.org/WAI/tutorials/page-structure/headings/#main-heading-after-navigation
Example 2 on that page shows a common pattern, where the first heading is an H2 that identifies header navigation, with the H1 describing the page title coming later in the content area.