Yes, John Boyd Orr served as a soldier in World War I. He joined the Royal Army Medical Corps in 1915 and served in France and Belgium. He was wounded in action in 1917 and returned to Britain to work in a military hospital. He was discharged from the army in 1919.
The Remarkable Journey of John Boyd Orr: A Scottish Educational Pioneer