Two things which might be of use are 1) adapters that convert the coax/barrel connector of the wall-wart into screw terminals - about 50 cents on eBay, and 2) a DC-to-DC module which generates user-settable regulated DC voltage - about $1 on eBay. Both of these have been discussed in other OGR threads.
For example, many Lemax lighted accessories and Miller Engineering animated signs operate off 4.5V DC (3 x 1.5V batteries). There have been many threads about using 12V DC LED strips for layout lighting (buildings, station platforms, etc.).
Most wall-warts are electrically isolated which make them suitable for isolated-rail block-occupancy detectors or layout accessory triggers.
Some motor-driven layout accessories work best if you can fine-tune the voltage rather than being "stuck" with the fixed accessory voltage from many transformers. A recycled wall-wart plus a regulator module is an economical way to do so.
One size does not fit all so a specific wall-wart may not have a suitable voltage/current/power capability to power a specific application. But these are minor details which can be discussed as needed.
And to Arthur's point, definitely read the fine-print to see if the wall-wart may be AC output. In which case you can also buy AC-in, DC-out adjustable regulator modules for not much more.
Bottom line: answer to your question is "yes".