Can a NM resident buy a rifle in Texas and transport it back to nm?

Yes- if the purchase is from a licensed Dealer. A private seller may only sell to a resident of his home state, or to a licensed Dealer/ Collector in any state. A handgun may only be purchased in your home state, but a rifle or shotgun may be purchased in another state. (Except California, which has a state law that prohibits its citizens from buying guns in another state)