The Building Code governs the design of the building (structure, serviceability, layouts, means of egress, etc), it does not govern the usage of the buildings on the lot. The Planing Act (aka zoning) will govern usage.
You can definitely have more than one dwelling on a lot, there is nothing unusual about that. Just the intended usage needs to conform to the zoning. The big governing factor with the City of Toronto will be lot coverage. There are limits as to the allowable ratio of gross floor area with respect to the lot area. For example, the allowable lot coverage in many areas of the city of Toronto is 0.45. I.e. if you calculate the gross area (in square feet say) of your building (all floors except the basement (unless it has been converted to living space)) and then calculate the area of your lot, your gross floor area cannot exceed 45 percent lot area. If you want to go over the 45%, then you need to apply for and be granted a variance with respect to the zoning. Since a detached garage is not living space, it's gross floor area is not included in the calculation. But the second you do make it into living space, then the gross floor are of the garage IS included in the calculation.
Now there may very well be constraints in the City of Toronto Planning Act that specifically do not allow you to convert a detached garage to a dwelling under certain (or all) circumstances. I don't know the answer to that. But a trip to the Building Department at the City of Toronto can answer that question.