How do the mechanics of garrisoning units work?
Only the Vinci and the Third Race have buildings that allow the garrisoning of footsoldier units, and both of them arrive during middle-late game, so in the context of the original question about garrisoning; no. You cannot garrison units within a city or its districts. However, cities do possess their own defensive capabilities, and you can even see foot soldiers running around on the walls of the city, firing at nearby enemies. Military districts provide increased defensive capabilities to a city as well.