Overseas military bases, consulates, and territories (e.g., Canal Zone) are considered American territory for purposes of determining citizenship.
McCain's citizenship status or anybody else's citizenship status has nothing to do with the territorial status of a U.S. military base. If a German national and her German husband are visiting their American friends at a U.S. military base and she goes into labor and delivers a baby on that U.S. military base, her child is not a U.S. citizen.
McCain is a U.S. citizen based on the Naturalization Act of 1790 that states, "the children of citizens of the United States that may be born beyond Sea, or out of the limits of the United States, shall be considered as natural born Citizens".