It is possible, but in my opinion not worthwhile.

Replacing the engine is expensive and leads to sky-high insurance premiums. There is no guarantee that the DVLA will change the V5C logbook or that TfL will detect the change to provide exemption from the ULEZ charge.