In InDesign (any version of it), anything that ends in a hard return is considered a paragraph, and can have a specific paragraph style applied to it. Yes, this also applies for single-word headers and subheaders.
Even a single number like, if you type "5" and hit return, you have created a paragraph, even if it only includes a "5" as content. Even if you make it a huge font size and it renders as a huge, bold "5", InDesign still treats this as a paragraph, as long as it ends in a hard return.
So yes, hard returns are 100% the proper way to end a header and subheader, regardless of their length.
Try to avoid adding multiple hard retuns, instead use space before & after under paragraph styles to adjust spacing.
Tip: you can hit CTRL+ALT+I to show hidden characters and this makes it easier to check where you have returns, soft returns, spaces, tabs, etc.
Even if you type "1 enter 2 enter 3 enter" and so on, you are still creating distinct paragraphs and those blue hidden characters will show you where each paragraph ends.