Cities do not have a sheriff. Counties have sheriffs, not cities.
San Francisco is unique in that it is a City AND a County within the same boundaries.
There are several cities like this. New York is one city that covers 5 counties (commonly burroughs). Some cities like St. Louis and Baltimore are independent cities, not part of any county (so de-facto they are their own county).