Well, 'to pull your socks up' has meant to make a special effort to improve and that probably originated in a mother's/teacher's instruction to a schoolboy in the old days when boys wore short trousers and were constantly seen with their actual socks rolled down...not very neat!
'Work your socks off' is quite likely to be a variant on that same idea...ie trying really hard.
'Socks' were a popular source of other idiomatic phrases such as 'put a sock in it' - meaning to be quiet - and 'knock the socks off' - meaning to beat someone thoroughly.