If you can, then it’s absolutely recommended. Not all sock brands are the same size, just like it depends on the brand if you need a size small shirt or a medium. If there’s a local running shop nearby, chances are they allow customers to try socks on before purchasing them.
They’ll help you get the right fit, and if you’re buying shoes at the same time, you can kill two birds with one stone. Just be courteous and make sure you arrive with clean feet.