Absolutely. The small towns between San Francisco and San Jose are all very safe (with very few notable exceptions). Even East Palo Alto is much more safe compared to 40 years ago.
I know people in Piedmont who cannot leave their town at night. They are completely surrounded by Oakland.