Since Word headers and footers are designed to repeat on each page of an output, you can't use merge fields in them. The result will be that the value from the first record in the data source will repeat on each page, no matter which record the page is reflecting. If your output is always a single record (for example from a merge button), then they may not be an issue and you could use merge fields in the header or footer. Note that QR codes and Barcodes may not render properly if they are in the header or footer.