I'll assume you have stadium attendance related things figured out. Oaklands is close to a freeway, San Francisco's looks more complicated. You say "family," so I might not be entirely negative about visiting the area. Adult "family" versus kids would be different things. We livein soCal and have visited the area a number of times but don't stay in San Francisco proper. It's crowded, busy, expensive, parking sucks. "Street" conditions can be bad.
Oakland is a mess, I can't think of anything particularly worth visiting there anymore. Maybe pass through on the freeways to get to/from wherever you stay. San Francisco is a beautiful city with a lot of ugly people things going on. Car break-ins are common. Fisherman's Wharf is overly touristy these days. Golden Gate Park has a variety of gardens and museums, worth looking up. There are drive guides I guess to see some of the sights. Lombard Street is fun. Driving can be "interesting" in some of the steepest neighborhoods. Cable cars are fun. Not sure which lines to suggest or how easy it is to get to one and make a round trip. Well worth it with kids. Highly touristy but also used by locals at times. Look it up. See the bridges. The view back to San Francisco from Treasure Island on the Bay Bridge is nice, beautiful at night. The Golden Gate Bridge is spectacular and there are spots for viewing in the parks around the area and it can be walked if desired. check out the Presidio and golden Gate national Recreation Area.
Aside from the commute times and general traffic density, I might suggest staying someplace not too far north of San Francisco if considering going north to the redwoods, etc. If you go west on Highway 1 not too far north of the bridge, it will get very rural, very quickly and the ride along the coast is beautiful. Not fast. Muir woods gets your redwoods very close to the bay but it can be crowded. As you go north on 101 you get into the wine country. A winery visit or two is more fun for adults. some tours might work for kids, they might (depends on interests, age) might enjoy seeing all the big tanks and barrels, etc. Driving north on 1, the coast is very pretty, just slow. 101 is a freeway but pleasant, small towns going from wine country to lumber country. A lot of state parks, follows rivers in some areas. If you go to the Sierra national parks, from the bay area, there's some mountains/hills then you'll hit the flat central valley. Maybe some Sacramento delta islands, etc., as you go, much depends on your routes, where you stayed in the Bay Area,then enter the Sierra foothills then climb to the mountains. the vally isn't all thatinteresting.