No, it's not the same engine.
As of now, there are a few different "forks" (if you will) of the Source engine.
There's the original HL2 engine (No games use this anymore.. they were all upgraded to the "Orange Box" engine).
Ep1 didn't bring an engine update, just a few tech additions that were merged back into the HL2 engine
Then there was the Orange Box Engine. TF2, Portal, Ep2 (and now Ep1, HL2, CS:S, DOD:S are all running Orange Box). This is the first OSX compatible engine as well.
L4D then took off and made its own additions (AI Director, Cinematic Effects). This is the Orange Box engine with a bunch of modifications.. enough that it is its own, seperate "L4D" engine. L4D2 was more extensions on the same.
Portal 2 uses the Orange Box engine, with more modifications. However Source is modular, so different bits can be mixed and matched with ease.
In short: Currently there are 2 forks of the Source engine (after a lot of merging).. There is the Orange Box engine (with HDR, Blur, Achievements and such) and the L4D engine (AI Director is the major identifying feature to it).