In military use, caliber refers to not only the bore diameter, but also the barrel length, expressed in bore diameters. Our battleships mount 16inch 50 caliber rifles, 16inch bore diameter, barrel 50x16" long.
In common usage (what you would call slang) someone asking the caliber of a gun is asking the chambering, not the bore size. Yes, it is imprecise, but it usually gets the message across.
Cartridge names reflect a wide varity of innaccuracy, when it comes to the number used for "caliber". Sometimes it is the nominal bore size, sometimes it is the exact bore size, sometimes its only close, and sometimes its not even close.
Makers name their cartridges to give a rough indication of bore size (usually, but there are exceptions), and some other distinguishing name, often, but not always the manufacturer that first put it on the market.
.223 Remington does not use .223" bullets. .222 Remington, .222 Rem Mag, and .22-250 Rem don't either. All use .224" diameter bullets. .240 Weatherby, .243 Winchester, .244/6mm Remington all use .243" bullets.
.380ACP, 9x19mm(9mm Luger) and many other 9mm rounds use .355" bullets. 9mm Makarov does not. It uses larger .362" bullets.
".38" caliber pistols mostly use .358" bullets.
US .30 caliber rifles use .308" bullets while many Eurpoean ".30s" use .311".
.38-40 WCF is actually a .40 caliber round.
.44SPL & .44 Magnum use .429" bullets.
It's like the English language, confusing to outsiders, but everything follows the rules, except for...the exceptions (and there are a lot of them!).