In most cases, yes they can, sometimes with even better than original parts.
This includes output devices, usually in TO-3 or TO-3P packages, through to tiny little TO-92 devices, and everything in between. The art lies in understanding how to substitute transistors and which parts are appropriate to use in place of the original older types. I won’t be giving too much of that away!
It gets trickier when we consider certain MOSFETs and VFETs. Some of these are no longer available, nor are there suitable replacements. That being said, I’ve just repaired an amplifier with blown TO-3 MOSFETs and I used new, replacement parts from stock which worked perfectly. I have plenty more.
Most older devices have modern replacements and I keep a database of cross-references which I regularly update as I make new matches. This allows me to replace dead old devices with new ones. I have developed replacement processes for TO-66 devices used in Accuphase amplifiers for example and I keep hundreds of transistors in stock, including high-spec modern replacements for many vintage types including TO-39 and TO-66 types that are no longer available.