It depends on zoning, lot size, setbacks, and utilities, and the rules differ by city across this market. Confirm what is permitted before designing, because accessory dwellings are where projects most often die at planning.
More detail
Accessory dwelling rules vary more between neighboring cities than almost any other requirement, so the answer is genuinely local and it is worth getting before spending anything on design. What determines it. Zoning district and whether accessory dwellings are permitted by right, by special exception, or not at all. Minimum lot size, since many ordinances set a floor. Setbacks from property lines and from the primary structure. Maximum size, often expressed as a percentage of the primary dwelling or a hard square footage cap. Height limits, which is what usually constrains a unit over a garage. Parking requirements. Whether a separate utility meter is required or permitted, and whether the unit may be rented or only occupied by family. And any deed restriction or HOA covenant, which can prohibit what the city permits. Cost reality. A detached unit is a small house: foundation, framing, roof, and full mechanical, electrical, and plumbing systems, plus utility runs from the main house or the street. Per square foot it costs more than an addition to the main structure, not less, because it duplicates systems that an addition shares. The sequence that avoids wasted money. Call the city planning department with your address before anything else and ask whether an accessory dwelling is permitted on that lot and under what conditions. Then check your deed restrictions and HOA covenants. Then survey the lot for setbacks and easements. Then design. Permit requirements are set by the city the property sits in, or by the county for unincorporated areas, so confirm with that office before design. On the Oklahoma side of this market in Bryan County, the same questions go to a different planning office with its own ordinance, so nothing here transfers across the state line without checking.