A lawyer can only practice in the state or district where licensed. That said, it is possible to be admitted pro hac vice to another state for a case. If the Mass lawyer is also licensed in NH, or has reciprocal admission, or has been granted pro hac vice status, then the answer is yes.
Disclaimer - the opinions expressed in this answer are for informational/educational purposes only are are not to be relied upon as legal advice. No attorney/client relationship is formed, and you should contact a lawyer in your jurisdiction to get specific legal advice regarding your issues.
As a "border hopper" with offices in both NH and MA I can tell you that there was a long standing sort of unofficial reciprocity in which the courts along the border would allow nearby attorneys from the other state to come in. If anyone tells you that didn't and doesn't still occur, they are not here observing reality.
However, technically and legally speaking it is correct that the rules do in fact require that an attorney be licensed in any jurisdiction in which the attorney wishes to practice. That's why I took the bar in both states. These rules do tend to be enforced more at this point.
However, now, after practicing in one state for a time, that attorney can 'waive' into the other state by filling ouf an application, but not taking the bar examination. And, an attorney in one state can always practice in another state by having an attorney in the other submit a pro hac vice petition. This is not a simple matter, but in fact in our two jurisdictions requires that the sponsoring attorney vouch for the other attorney and be present at all court appearances. I have done this for other attorneys only who I know quite well and trust.
I am not certain of the context of your question. If an attorney has stated to you that s/he can not represent you because they are not licensed in the other state, they are telling it to you the way it is in the rules.
This answer is provided for informational purposes only. Actual legal advice can only be provided in an office consultation by an attorney licensed in your jurisdiction, with experience in the area of law in which your concern lies.