To upgrade a building is to make it stronger. You need to have a Command Center of the same level to upgrade a building. For example, you need a level 4 Command Center if you want to upgrade your Gun Turret to level 4. But there are some buildings that you need a Command Center of a certain level to build even a level 1 building of that kind, e.g. you need a level 4 Command Center to build a Factory.