O'Leary was born in 1943. As the son of a career Army officer, O'Leary moved with his family to many different states during his childhood. He graduated from Frankfurt American High School, while living with his family overseas in Frankfurt, Germany. O'Leary attended the Georgetown University School of Foreign Service and graduated in 1966 with a Bachelor of Science Foreign Service (BSFS) degree with a major in economic theory. In 1966, O'Leary received a State Department appointment as a Foreign Service Officer. He also served as a reserve officer of artillery in the New Jersey National Guard from 1963 to 1968. He completed the course work for a master's degree in economic theory from Georgetown University in 1967. Immediately prior to being elected the Treasurer of Arlington County, O'Leary served as president of NOVA Research Associates, a computer operations firm.