 He was the son of William Hay Dyer (1788–1862) and Margaret (née Brydie) Dyer (1796–1888)

Dyer graduated from the United States Military Academy in 1837 as 6th out of 50 cadets.He served in the Seminole Wars 1837–38 in the 3rd US Artillery and as Lieutenant in the Ordnance Corps.In the Mexican–American War in 1846–48, he was brevetted Captain for gallant conduct at the Battle of Santa Cruz de Rosales.