Simple geometry: Circles are strong, and provide a large area for the amount of material used. That means you get more intake/nozzle for the cost of the materials, while giving you a strong and (relatively) light engine.
A circle also helps to keep the airflow smooth, because it's (again, relatively) uniform: no weird edges, corners, or angled things to cause turbulence, vortices, or otherwise disturb or make the airflow "complicated". This is ideal at subsonic speeds.
Overall, this makes a circular engine the most efficient, and when it comes to commercial aircraft efficiency is king: the lighter and simpler you can make a safe engine, the better.
In some aircraft we will see "off-circle" (eg 737 engines, which have a not-quite-circular intake) or oval intake, but they're basically just circles where the dimensions have been adjusted to take a slight efficiency hit for the purpose of fitting the shape of the aircraft better.
Military aircraft which use rectangular air intakes tend to do so for two different reasons, rather than because it's actually any more efficient.
- Stealth. Circles scatter radar waves in a "bad" way for stealth. Angles are much better for stealthy aircraft
- Because that air intake is actually an Intake Ramp designed to slow the airflow into the engine by deliberately creating a shockwave to slow the air down. This is because jet engines need subsonic air to work properly: this is why you tend to see square intakes on supersonic aircraft. Commercial aircraft don't usually fly supersonic, though, with the notable exceptions of Concorde and the Tu-144 which both had square intakes for this reasons.
If you don't care about subsonic efficiency (Concorde/Tu-144, which were both designed to spend most of their working lives supersonic), or if you just want to be able to go supersonic at all, a square intake can make sense - but for those of us living life under Mach 1, and for airlines who care about fuel efficiency above pretty much anything else, a circle is best.