There absolutely is something called "trail legs". It's well known/understood among long distance backpackers. How long it takes to get your legs depends on what condition you're in starting out; if in great condition, doing a lot of walking it can be as little as a week. Or it can take two or even three weeks to get your legs.

By that I don't mean that before you're fully/maximally tuned that you have a lot of problems. You're just not up to optimal walking fitness in terms of legs strength and having those muscles tuned for walking all day.

The flip side is that most thru-hikers I know are loathe to take too long off the trail, and from talking to various folks the consensus is that after about a week you "lose your legs". And then depending on how long until you get back on trail it might take a week to get them back. In the meantime, you're still a relatively strong hiker, you're just not fully back in top hiking shape yet --- you walk up hills slower and feel more tired as a result, that sort of thing.

Among distance hikers I'll also note that nobody stretches or does any sort of special training or care or whatever. Walking all day, most days, for months gets you fully in tune for walking, it's just the normal thing to do.

Now, if in optimal walking shape where you hadn't been doing anything else, if you were to suddenly do some other intense leg-thing, say, some rounds of one-on-one basketball --- likely you could hurt yourself. Because some muscles are extremely strong, while others haven't been getting much use.

It's a cool feeling to be in the best shape you can be for walking. I wish it lasted longer after the trip stopped.
_________________________
Brian Lewis
http://postholer.com/brianle