During the Second World War, MacMillan served initially in England, putting in place defensive strategies against a possible invasion by the Germans. He was appointed Brigadier General Staff IX Corps in December 1941, remaining in this post during the Operation Torch landings in North Africa and through to the fall of Tunis in May 1943. He was given command of the 152nd Brigade in June 1943 and led it during the successful Sicily campaign. Upon return to Britain, he was assigned command of the 15th (Scottish) Division and led the formation during the Battle of Normandy, Operation Epsom and Operation Bluecoat, towards the end of which he was wounded. Once recovered, in November 1944, he returned to mainland Europe as GOC 49th (West Riding) Division near Nijmegen. Upon the death of Major-General Thomas Rennie, he assumed command of the 51st (Highland) Division immediately following the crossing of the Rhine on 23 March 1945.