Over the years I've done several cross-MA-boarder transactions, as a resident of MA, CT, and NH. Most states work the way you describe, but MA (and CA) absolutely does not. If you take delivery of a car within MA, sales tax is due, period. Your state of residency/state of registration is irrelevant.
It's right there on the Mass Dept of Revenue site,
Motor Vehicle Sales and Use Tax
If a NH buyer buys a car in Lowell, legally they have to pay MA sales tax. The only way around it is for the dealership to deliver the car to the buyer outside of MA. I have a friend who worked as a driver for a MA Chevy dealer. In addition to cross-dealer trades, he delivered a bunch of cars to people's homes in CT and NH, where they signed the final paperwork and handed over a cashier's check to avoid MA tax.
That's why Tesla sends NH buyers to NJ. Originally it was Mt Kisco, NY, and they gave a NJ temp tag, but NJ called them on it, so now we have to go to NJ to get a NJ temp tag.
EDITS: stupid grammar mistake, clarified MA Chevy dealer to out of state buyer.