WW2 piston engines were clearly capable of further improvement and some lateral thinking in the day.
Here are several of the technologies that are common today that could have been introduced in the early 40s.
1 Variable Length Intake Ports. The From the DB601E Daimler Benz Introduced a radical valve overlap to resonance scavenge the cylinder head of end gasses and pressurise it by placing an node there. The variable length was necessary to ensure the engine idled and started smoothly. Direct in cylinder injection prevented fuel loss.
It should be noted that the excuse given for Rolls Royce not introducing this system that it would give up the charge cooling effect of injecting the fuel into the supercharger (precooling it) was overcome in the BMW801D2 from late 1943 onwards when 'rich mixture' injection was introduced to provide emergency power by injecting the fuel into the eye of the supercharged during WEP.
2 Variable Valve Timing. The BMW802 18 cylinder radial was to be available with variable valve timing on the exhaust. This achieves the same effect as changing the inlet manifold length. Engines like the R3350 needed fuel injection anyway due to the fuel distribution and fractionating issues they faced.
So the above are clearly possible but never applied to allied engines.
3 Knock sensors. This can be implemented in and around WW2. The older Waukesha CFR test engine simply used a pin that bounced up and down when knock was detected. It was visually extremely obvious. This itself could be used to drive a small electrical motor to advance or retard the ignition. A knock sensor is really just a microphone/accelerometer.
Knock sensors could be introduced to retard ignition (with an electrical motor) when knock is detected and if a 10% retardation of ignition doesn't stop the knock the boost can be reduced.
This allow the engine to operate with much higher boost settings or delivered with higher compression ratios that could otherwise be risked given the dangers of unusual hot condition or variable fuel quality. This appears to have been part of the problem the Germans suffered with the DB605A in raising boost from 1.3 to 1.42 ata and again from 1.8 to 1.98 ata.
Thermionic Vacuum Tubes (Valves if your British) were well up to the task. If operating at audio frequencies (not VHF/UHF) the valve could easily last 30,000-50,000 hours and handle 60G acceleration. They would be quite suitable. I don't think they'd actually be needed.
4 The Lambda Probe Oxygen Sensor is attributed to
Robert Bosch GmbH during the late 1960s under the supervision of Dr. Günter Bauman. Im not sure if there was an equal sensor possible at the time, but I think there probably was. It would be useful for the kind of 2 stroke engines people were working on and indeed I see no problem incorporating it with the controls of the day. I'm just not sure if there was such a device in existence.
Personally I think had it not been for the jet engines 2 stroked turbo supercharged disels were the future. They stood a chance of actually producing 4000hp on 12-16 cylinder instead of 24,28 or 36.