With the exception of scramjets, jet engines, deprived of their inlet systems can only accept air at around half the speed of sound. The inlet system's job for transonic and supersonic aircraft is to slow the air and perform some of the compression.
The limit on maximum altitude for engines is set by flammability – at very high altitudes the air becomes too thin to burn, or after compression, too hot. For turbojet engines altitudes of about 40 km appear to be possible, whereas for ramjet engines 55 km may be achievable. Scramjets may theoretically manage 75 km. Rocket engines of course have no upper limit.
At more modest altitudes, flying faster compresses the air at the front of the engine, and this greatly heats the air. The upper limit is usually thought to be about Mach 5–8, as above about Mach 5.5, the atmospheric nitrogen tends to react due to the high temperatures at the inlet and this consumes significant energy. The exception to this is scramjets which may be able to achieve about Mach 15 or more, as they avoid slowing the air, and rockets again have no particular speed limit.