Leg (or limb in general) work doesn't really ALWAYS have to pay off, I think. Sometimes Wrestler A will work Wrestler B's leg and Wrestler B can find ways to get around it and win without any pay off to the leg work. The leg work is sort of there for filler, yeah, but it's fun and effective filler to me. Bret would work the leg for some help with the sharpshooter (or in Diesel/Bigelow/any tall guy or fatasses case- to keep them off of their feet). He may not win with the Sharpshooter, but if we're supposed to take our delusional little views that wrestling is a real fight at any point, Bret working the leg-> going for the sharpshooter-> not winning with it, still makes sense. He tried to work the leg to wear his opponent down to win the match, but failed.
I agree with this. I mean its great when the body of the match plays into the finish, not only because it feels like everything prior to it had purpose and meaning, but also because it comes off as smart and adds rhythm and flow to the match.
As you said though, the opponent may be able to work around the limbwork and as long as the limbwork is sold enough to convey some form of drama in that the opponent is noticeably struggling then I have no problems with the match shifting away from it. A good example might be the Ohtani vs El Samurai NJPW match. Ohtani makes the leg his focus but as the match progresses he attempts to use his signature offence but alters it towards the leg, e.g the springboard dropkick is directed to the leg rather than the back/upper body as it usually is. Ohtani also uses the leg as a point of escape and as a way to setup a signature move, such as kicking the leg and then immediately following up with the bridging full nelson suplex.
So long as the limbwork is either sold well enough or at least presented in a way that its not forgotten about and therefore rendered useless, it doesn't necessarily have to pay off in the finish. Though of course when it does it can really add to the overall quality of the match, but that's the case with any smartly structured match.