No
HL2 was made in 2004
Gmod was made in 2006
Gmod was developed by different people who used the same game engine Valve used for HL2 and made a sandbox game off of it. Its default characters were based off of Half-Life NPCs like the City 17 citizens and rebels for example.
So no, Gmod was based off of HL2.