Yep, that’s exactly how flashlights are cooled. The high-power LEDs we’re talking about have a third solder pad on the back, which is an electrically neutral thermal contact. That contact is soldered to a copper disk, which is in turn covered in thermal compound and screwed to the body of the flashlight, or other heatsinking system.
The “problem” with this is that the flashlight can absorb a tremendous amount of heat for the first few seconds until it warms up, but can only dissipate heat at a slower rate. Flashlight manufacturers capitalize on this to advertise extremely bright settings which can only function until the light heats up. I personally think this is fine, basically giving me free light. But a lot of people very reasonably argue that the manufacturers should at least advertise how much light can be produced once the flashlight has reached equilibrium and is trying to dissipate the heat created.