The New Hampshire law against trespassing says
I. A person is guilty of criminal trespass if, knowing that he is not
licensed or privileged to do so, he enters or remains in any place.
State law does not specify what conditions constitute having license or privilege. The Franklin city code specifies one form of privilege.
A:The Fire Chief or his or her authorized representative shall have
the right to inspect all premises, except owner-occupied detached
single- or two-family structures used exclusively for dwelling
purposes. These inspections shall be made in accordance with the
systematic inspection program and as often as may be necessary for the
purpose of ascertaining and causing to be corrected any conditions
liable to cause fire, contribute to the spread of fire, interfere with
fire operations or endanger life or any conditions constituting
violations of the provisions or intent of this article. Except in the
case of systematic inspection programs or other good cause,
inspections shall not include occupied dwelling units.
B: Whenever necessary to make an inspection to enforce any of the
provisions of this code, or whenever the Fire Chief or his or her
authorized representative has reasonable cause to believe that there
exists in any or upon any premises any condition which makes such
building or premises unsafe, the Fire Chief or his or her
representative may enter such premises at all reasonable times to
inspect the same, provided that if such premises shall be occupied, he
or she shall first present proper credentials and demand entry, and if
such premises shall be unoccupied, he or she shall first make a
reasonable effort to locate the owner or other persons having charge
or control of the premises and demand entry. No owner or occupant or
any other persons having charge, care or control of any premises shall
fail or neglect, after proper request is made as herein provided, to
promptly permit entry therein by the Fire Chief or his or her
authorized representative for the purpose of inspection and
examination pursuant to this article. If the owner or occupant denies
entry, the Fire Chief or his or her authorized representative shall
obtain a proper warrant or other remedy provided by law to secure
entry.
This ordinance does not grant firefighters the right to snoop on people's property whenever they want. So this does not "override" state law. If you refuse admission, they must obtain a warrant (constitutional requirement), making the justification subject to judicial review, i.e. conformity with the states grounds for such entry. The clause "No owner shall fail to promptly permit entry" is a rhetorical admonition, not an enforceable clause, and an ordinance cannot suspend the 4th Amendment.