Summary:
With the single exception of the monument, which has no prerequisites and is available to build at the start of the game, you need knowledge of a specific technology to construct a building. For example, you must learn bronze working before you can build a barracks.
Some buildings have resource prerequisites as well - for instance a city must have an improved source of horses or ivory nearby to construct a circus.
Also, some buildings have building prerequisites. You can't build a temple in a city unless you've already constructed a shrine there.