Does the order of leg exercises matter when you want to get stronger?
Unless your objective is getting stronger in a specific movement which involves a specific motion (for example, you're a powerlifter who wants to get strong in the deadlift), then, no, the order makes no long-term difference (and, even if you want to become strong in a specific movement/motion such as the deadlift, exercise order can be and often is intentionally varied during long-term training).
In fact, for example...bodybuilders (I'm age 63, been bodybuilding for forty-six years), when working quads/hams use varying programs with sequences such as: leg presses, front squats, leg extensions, leg curls............leg curls, squats, hack squats, straightlegged deadlifts....leg extensions, leg presses, leg curls, squats......etcetera.
It's true that the sequence will affect the amount of resistance you can use on subsequent exercises, but, that won't affect your overall "getting stronger". For example, if you did that last program, you'd be forced to use lighter squats than you would doing a program which has squats done first. But, again, that won't impair you from getting overall stronger legs.
Decide on a program that "feels" better to you than others, and use it, whatever the order of leg exercises. The benefit is psychological more than anything - you're more apt to sustain something you like doing better than something you don't like as much.
Don't mistake "more exercises" as a means to make faster or greater progress - a program of, say, leg presses, lunges, and straightlegged deadlifts (those work your hamstrings) , or, say, squats, leg curls, and hack squats, is enough. You don't need a program of 1,000 different exercises to get stronger.
Becoming stronger means "gradually becoming able to handle more resistance than before". As long as, as weeks and months pass, you gradually increase resistance on those two or three exercises you do ( by gradually adding reps while using the same poundage, and/or, gradually adding poundage while using the same number of reps), then you will be getting stronger.