Donald Johnstone McGavin was born on 19 August 1876 at Chatham, Kent, England, the son of John McGavin, a draper, and his wife, Jessie Burns. Donald was educated at King Edward VI Grammar School and at Mason University College in Birmingham, and then at the London Hospital. He qualified LRCP in 1899, MB in 1900 (achieving a gold medal in medicine and obstetrics) and MD in 1901. He also studied for a period in Heidelberg, Germany.
McGavin served as a civilian surgeon in the South African War, and worked for eight months in the Natal district with the Royal Army Medical Corps. He then came to New Zealand to practise in rural Hawke's Bay, registering as a medical practitioner in New Zealand in April 1903. On 27 August that year, in Wellington, he married Mary Allan Chapple. McGavin gained his FRCS in England in 1904. Returning to New Zealand he commenced practice in Wellington as a surgeon.
In Wellington Donald McGavin also became a volunteer medical officer attached to the Union Rifle Volunteers as a surgeon captain. He transferred to No 5 Company, New Zealand Field Hospital and Bearer Corps in May 1906, and was promoted to major later in the year. In September 1914 he was appointed principal medical officer of the Wellington military district, and went overseas on active service in May 1915 to command No 1 New Zealand Stationary Hospital. The hospital was initially stationed at Port Said, receiving casualties from Gallipoli, including Bernard Freyberg. It was then moved to service British troops at Salonika, in Greece. When the transport ship Marquette was torpedoed in the Gulf of Salonika, several members of the unit were lost. The hospital remained at Salonika during the winter of 1915–16, then joined the New Zealand Division at El Moascar on the Suez Canal. It followed the division to France and was stationed at Amiens behind the Somme front.
McGavin became assistant director of medical services for the New Zealand Division in October 1916, and served in the position during the last years of the war. He was mentioned in dispatches four times. In 1917 he was made a DSO for his crucial role in the successful evacuation of the wounded during the division's heavy offensive at Messines (Mesen) in June. He went into the advanced area to encourage stretcher bearers and to superintend the removal of casualties.
After the battle of Messines, McGavin participated in operations at Passchendaele (Passendale), Bapaume and St Quentin-Cambrai. Towards the end of the war he was with the New Zealanders when they took the walled town of Le Quesnoy by escalade (mounting its ancient ramparts on ladders). In 1918 he was made a CMG and in January 1919 was recalled to New Zealand.
From 1919 to 1924 Donald McGavin was director general of New Zealand Medical Services and medical administrator of the Pensions Department. He was knighted in 1921 for services to medicine. A year before his retirement to the reserve list of officers in December 1924 he was promoted to major general. At the age of 48 he re-entered surgical practice with a consultant appointment to Wellington Hospital. In 1927 he was one of the five New Zealand representatives at the launching of the College of Surgeons of Australasia (later the Royal Australasian College of Surgeons). As secretary to its New Zealand committee for 20 years, he played a large part in establishing the college during its formative years.
McGavin also served on other medical bodies. He chaired the New Zealand Branch of the British Medical Association, its Wellington division and the Medical Council. He was surgeon in chief of the St John Ambulance Brigade and was made a commander of the Order of St John in 1945. He was appointed medical representative on the Council of Defence before the Second World War, and during the war was on the medical advisory committee to the minister of defence.
From 1920 to 1924 McGavin was honorary surgeon to the governor general. He was a member of the Prisons Board and the War Pensions Medical Appeal Board, a president and trustee of the Wellington Club, and chairman of directors of the Wellington Publishing Company for 10 years. He died in Wellington on 8 May 1960, survived by a son. His wife, Mary McGavin, had died in 1955.