SFO is your port of entry to US. You need to go through immigration and custom then pick up your baggage and following the sign to the transfer area and check in it again then you may go to the gate of your next flight.
If you are going outside the SFO airport, then you go through the customs there and take a domestic flight to San Diego. Airport termin0als are based on airlines. Domestic flights don't have a customes area. Check with the airlines or your travel agent.
Thanks! Your answer is awaiting moderation.