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:
Headings on a page are great for SEO & accessibility, but they're not going to make or break your sites rankings. Be reasonable in what you mark up as a heading, pick things that help to explain what the pages are about. See it a bit like highlighting something on a page that you hand out -- you want to make it clear what the page is about, but if you use too much of it (or don't highlight anything at all), then it'll take more effort for the other person to understand at a glance.
Forum discussion at Reddit.