Maybe, but you can't throw out the building codes. A warehouse, certainly, can be retrofit. But office towers? Almost certainly not.
Elevators are not sized for residential; electrical service not sized for residential loads (dishwasher/dryer/microwaves/ovens); HVAC not sized for residential heat loads (same as above); metering requirements means the existing electrical rooms are not large enough (they are never large enough); plumbing and sewer are not sized for residential.
It goes on and on. Even if you got the building for free, you'd still want to run the numbers to see if it's still cheaper to demolish and build again. It's not entirely clear whether it is or is not.
It can be done if you make huge, expansive apartments, which has to be read as "really expensive". There aren't that many really rich people who can drop 5 figures per month for an apartment.