Hello,
The firstMatch option works correctly in headers and footers, but it replaces the first occurrence of the placeholder of each header and footer.
Please note that in MS Word headers/footers work per section, not per page. So if the contents of a section fill more than one page the same header and footer is used. MS Word allows generating new headers and footers per section, not per page, but you can do page section breaks to generate new pages for new sections.
We recommend you to work with as many DOCX documents as needed with their own sections, do the needed changes with phpdocx and then merge the documents into a single DOCX using mergeDocx.
About the firstMatch question, it can be used iterating the values to be replaced. The first match is replaced and the placeholder removed, then the next one and so on.
Regards.