Yes, you can legally drive in socks. However, just as with wearing high heels or flip-flops, you may not have the same reaction time or control over the pedals while driving in socks. It could be risky to drive in socks if it affects your ability to drive safely. You also increase the likelihood of an accident if one of your socks snags on a pedal, which could cause you to accelerate or brake in an unsafe manner. In situations like this, it is potentially more dangerous to drive in socks than it is barefoot.