Just because it is the norm, it doesn't mean that somebody made it so because they thought it was superior design. It can be just convention.
Coke bottles are plastic today, but used to be glass until a few decades ago. Glass bottles were invented round, because they were made by manually blowing liquid glass, and it is very hard to blow a non-round bottle. In later times, processes for non-round bottles were invented, but they are typically used with expensive drinks (whiskey, some liqueurs) where a production cost for the packaging is not going to have significant impact on the product price. Normal glass bottles for wine, beer, soft drinks and milk (!) stayed round in the industrial age. And when coca-cola became popular, it just used a variation of the standard.
By now, the original constraint for creating a round bottle is long gone, as it is not even made of glass any more. But by the time Coca cola switched to plastic bottles, the existing bottle shape was already an iconic part of the brand. So they have a very good reason to not switch to a canister-style bottle.
As for the milk, the public has long accepted the switch from glass to non-glass packaging. I don't know whether it was possible to create food-safe (some of the baddies used in plastic production are fat-soluble), non-transparent (light degrades milk but not cola) and light-weight containers shaped like a milk bottle at the time the switch took place, but the manufacturers opted for certain materials (like lined heavyweight paper) and for the shapes most efficiently done with these materials. As they were not bound to a conventional shape any longer, they could start exploring functional changes to their design without alienating their customer base. By the way, the old-fashioned milk bottle still has iconic value, and gets used by premium brands for this reason, even though the containers are functionally inferior.