The military in SimCity will usually ask the player for permission to place a military building in their city, which generates money at the cost of land and desirability.
In SimCity 2000, when the city is big enough. the government will ask the player to allow a part of the city to be in military use, such as an airfield, but it is placed randomly in the area. The Military can also be dispatched to respond to Disasters, and can handle tasks attributed to both the Police and Fire Department. If you don't have Police Stations or Fire Departments built when a Disaster strikes your city, the National Guard will be deployed in their stead (although only one or two units can be dispatched at a time, making them a less than desirable option for dealing with widespread disasters). Once buildings for both are constructed, the Military will no longer be an option, unless the player accepts the government's proposal of building a Military installation in their city and they successfully find an area.
However, this won't count if military structures are manually added to a city by means of the Urban Renewal Kit, since the option to Dispatch Military only becomes permanent if the proposal is accepted by the player. Furthermore, the Military get a special black zone (unavailable to the player) to themselves, and their buildings can't be demolished, nor can you place buildings, power lines, or even roads of your own on top of areas that Military zones cover, or even run pipes/subway tunnels underneath them. You can, however, place Water on tiles zoned by the Military and then bulldoze over them to make them blank/usable to you again.
In SimCity 4, you can simply unlock a military base, which is a business deal awarded after running low on the city's funds, but also take a lot of place, like in other games. The player cannot invade or attack other cities using military, although some disasters are similar to an attack, although not a ground invasion.