All planes can glide, but not to the same degree. The glide ratio, or the ratio between distance travelled per distance dropped, varies wildly between planes.
A purpose built glider has a glide ratio of about 60:1, so it could travel 60mi while only losing 1mi of altitude, while a Cessna 172 has a glide ratio of 9. Large passenger aircraft have glide ratios inbetween, with a 737 having a ratio of 17.
On the other extreme end you have military fighter planes, which tend to more closely resemble well propelled un-aerodynamic objects once their engines give out. The worst I could find was the F104 Starfighter, which has a glide ratio of 3-5 depending on its exact configuration. Dead stick landings of these aircraft tend to be rare, as the availability of ejection seats (especially before zero-zero seats became a thing) encourages a not-my-problem-any-more attitude among pilots who discover themselves absent a working engine.