There are 2 steps:
1)Make a building that can only be built in one city - one of iMaxGlobalInstances, iMaxTeamInstances, or iMaxPlayerInstances is set at one. An existing wonder can serve this purpose.
2)When making the Unit, set PrereqBuilding to the building in step 1.
Now, the unit can only be made where the building is and only 1 city can have the building. What mechanism is used to get the building into that city is up to you.