Dundas entered the British Army on 1 December 1797 as a second lieutenant. He served as an engineer officer in the Anglo-Russian invasion of Holland. He became lieutenant in 1800 and the following year he served in Egypt against the French campaign, including the Battle of Alexandria. He was promoted to captain in 1802 and major in 1804. In 1805, he served in the north of Germany with the Royal Staff Corps.