This is one of those subjects where crafters tend to have really, really strong feelings. There are many who would never consider making socks with a yarn which wasn't at least 20% nylon because why would you put all that work into something which will wear out so quickly without it. But here’s the thing – there is a growing camp of people (myself included) who not only believe that it isn’t necessary, but who go out of their way to find sock yarns without nylon.
For most of the long history of socks, nylon hasn’t been an option. You had a choice of wool, cotton, linen, furs/leather or nothing. It wasn’t until 1938 that nylon was first blended with wool. Knitters quickly discovered that not only did it extend the lifespan of handknit socks, but they had better elasticity and so held their shape better. Over time, we've experimented with adding different fibres to wool to improve upon different aspects - polyester and it's assorted cousins are added to improve the elasticity and moisture wicking, and if they hype on my son's work socks is to be believed, copper is sometimes added for odour control (which incidentally isn't really an issue in a pure wool sock because it's the synthetics which hold the odour!).
So back to the nylon-free sock camp. The first question is usually "Why?" I can't speak for everyone but many people are trying to reduce their plastic consumption. Microplastics in clothing are very real and and do up in water sources from laundering. Plastic doesn't decompose the way wool does so when the sock has outlived it's useful life, I can't compost it if there is a synthetic component (well, I can but will eventually have to do something with the tangle of nylon once the wool is gone).
Will any yarn do for socks? Depends on what kind of socks you're making. If you want a hard wearing work sock, then a pure merino wool probably isn't your friend. You want a tougher wool made with long strands which has a really tight twist that will tolerate the friction of a boot. Have a look at Blue Faced Leicester. If you want a luxurious bed sock or something to cozy up by the fire with that will never see the inside of anything other than your slippers, you can use a much softer fibre because it doesn't have to withstand that friction.
Curious? Give it a try!