It's feasible for older a/c (the Orbis DC-10, before that the DC-8) to be converted to portable clinics or surgical hospitals because they are still structurally sound, expensive on fuel per hour, but flown very few hours per year. Ditto other special rigs, engine testbeds, scientific vehicles, etc.
The list of retired aircraft converted to engine testbeds is a very long one.