Is is possible to put new engines in old classic car, say in the 1940?
Anything is possible if you have the time & most of all , the money.
Which is more expensive, obtaining and fixing up the body of the car or the putting in of the engine and mechanics?
Depends on if the vehicle was ever in a serious accident & the frame is bent/twisted. Or if there is severe visible rust on the frame & or underbody. Look for unusual welds or plating on the frame which would be a clear sign of a cover up from rust or an accident.
Custom fabrication on the install of a different engine , trans. Or rear can be costly. Having a custom driveshaft to accommodate the length of your new / custom install can cost you a cool Grand..... Trust me , I've done it !!!
I wouldn't need or want anything custom: starting off. Just basics. I suppose the engine would be the most expensive part and the frame of the car.