‘Header’ and ‘footer’ are not restricted to the top and bottom of the page but can also be used in sections where a heading and footer can also make sense in relation to that section.
It all depends on the content but the flexibility is there.
This is an old article but mentions these points (note that hgroup has been deprecated now).