The closest thing to a true serene backwoods hike in San Francisco [1] can probably be found at Mount Davidson (Dalewood St., West Portal, daily 6 a.m.–10 p.m., 0.5 mi, easy). Park in the adjacent West Portal residential area and wander through the gate and into the woods, or something like them.
Take the main fire road straight up the gentle slope to the top of the mountain, then find the smaller track off to the left that leads to the famous “cross at the top of the mountain.” To extend your stay in this pleasant place, either walk down the other side of the mountain, or head back to find the smaller branch trails that lead off into the trees.
For a stouter and better-known walk, take the trail at Glen Canyon (Bosworth St., 1 mi, moderate). Feel free to bring your canine companion on this trail through a lovely little unlikely urban canyon. It only takes about a half an hour to explore Islais Creek, the non-native eucalyptus and blackberry, and the attractive if non-spectacular views. Take care to avoid the prolific poison oak that spreads throughout the canyon.
Links:
[1] http://www.moon.com/destinations/california/san-francisco-and-the-bay-area