Seems both squats and leg extensions can be safe, if done right (including in the case of leg extensions the right equipment)
It is not as if some force z upwards is only resultant in an exercise-dependent split into compressive force y and shear force x, with x+y=z - so the question whether joints are 'better' able to withstand compressive forces vs shear forces falls short of the mark.
As i have no background in bodybuilding, here what i think you mean by the exercise of 'leg extentions':
here what i think you mean by 'squats'
and here what i think you mean by 'push ups'
I am not sure whether you included the push-ups in your Q to allude to similar exercises being available for non-knee regions, or whether you meant the load on the knee during push up (depending on how you model it, there is a clear shear component in that case) - I'll ignore the push-ups
There is a study (review of 150+ studies) regarding the loads during squats (though they look at squats with additional load on the shoulders), and whether deep squats or lesser squats are safer. They conclude deep squats are safer (if exercising with an expert) than shallower squats, and that (slow) deep squats are safe overall).
Calculated shear forces in the knee, even with absurd loadings (250kg of additional weight, didn't even know that was possible) remain manageable, though the authors note that calculated compressiive forces in the spinal column go beyond the theoretical limit, so the authors question the calculation...
Interestingly, the results for shear forces can be better predicted, because force pulling tendons apart is quite easily measureable in the lab, while the force (actually, pressure, which is even more confounding, because now even with a known force you need to know the area of contact precisely to know the pressure) necessary to compressively destroy cartilage (death of chondrocytes) is very non trivially found. The authors report values that are more than a factor of five from one another, the lower bound lying in the region that is surpassed in the hip while simply getting out of a chair...
The shear force in leg extension training can be made zero with the right equipment (pad needs to move to specific locations during exercise), according to this.
There even are papers that recount how the different muscles impact the tibiofemoral shear force (TFSF), which largely determines the tensile force on anterior cruciate ligament (ACL) and posterior cruciate ligament (PCL) - they conclude that with the right muscle activations during the exercise, leg extensions can be safe.