He traveled from the East coast to Texas. He settled to live in Nacogdoches, Colony, filed and received a Mexican Land grant for a single man's 1/3 league. Mexican land grant .
Mexican land grant, courtesy GLO
He joined the Texas military, and served in the siege of Bexar, Oct - Dec, 1835 as Private. 
In 1836 Sgt. John McGregor later was promoted, and remained in Bexar colony to serve in the Alamo garrison as a second sergeant. He was a member of the artillery company commanded by Capt. William R. Carey. 
Crockett and McGregor Feb 28, 1836
A story about John McGregor is that he had a set of bagpipes. Since the Mexican Army were firing upon them at various times, night and day, the story goes that sometimes during lulls in the fighting or gunfire, Davy Crockett played his fiddle and John McGregor played his bagpipes." "McGregor was one of four Scotsmen who died in the Alamo
Sgt McGregor was killed in the Battle of the Alamo March 6, 1836 with the Alamo Defenders. Remains were buried in San Fernando Cathedral.
Note: Republic of Texas approved for Sgt McGregor's heirs, Nacogdoches Bounty, 640 acres in Henderson Co., Nacogdoches 1st, 369 Acres, Henderson co.; and his original Mexican Nacogdoches land grant 1/3 league dated 1826-1835 for having fallen in the Battle of the Alamo.McGregor donation for Siege of Bexar service
↑ "New York, Passenger Lists, 1820-1891", index and images, FamilySearch