Google’s John Mueller said in a Reddit thread that while “headings on a page are great for SEO & accessibility, but they’re not going to make or break your sites rankings.”
So if you don’t use those H1 or H2 heading tags/attributes on your pages, it won’t make your site not rank well.
Of course, you probably want to test it and see if it does impact your specific page from ranking better or worse in Google search. But generally, it probably isn’t a massive ranking factor for Google.
Here is what John said fully:
Forum discussion at Reddit.