I am a UK citizen flying into Toronto, arriving 4pm in summer and flying onto SAN Fran leaving at 7pm. Is this enough time to clear Canada immigration and catch the forward flight? Would I also need US immigration clearance before departure? Is three hours enough time?
Air Canada's published minimum connection time from Canada to the US via Toronto Pearson is 1 hour 10 minutes. This may vary slightly for other airlines, but not by much. Quite a bit of that is the fact that you have a really long walk from your arrival gate to the transit corridor or to immigration.
With a three hour connection, you've got more than enough time to get to and through US preclearance. You'll probably spend most of the connection time bored out of your skull; there wasn't all that much past preclearance the last time I looked.
Note that it is no longer necessary for international transits going to US preclearance to clear Canadian immigration; most Canadian international airports (quite possibly all by now) now have a designated transit path from international arrivals to US preclearance that bypasses Canada immigration.
The airport website has a guide which explains exactly what to expect when you connect through Pearson.