I would argue the point, having worn a US Navy officer's uniform, "Tropical White Short" (white ss shirt with shoulder boards & ribbons, white "Bermuda" shorts, white web belt, white knee sox and white "buck" shoes), to dinner at the Italian Navy Officers' meeses in Livorno and Taranto and the old NATO mess in Bagnoli on several occasions. I seem to recall wearing the uniform at Casserta, a quite formal sort of establishment.
I would certainly not hesitate - especially in the current heat wave - to wear "dressy" shorts with a suitable shirt (Guayabera or the equivalent Phillipine shirt come to mind) to upscale resturants in most Southern coastal cities, the Bay of Sorrento, Taormina, Bari, Brindisi, Taranto - not on many tourist maps, Siracusa, but maybe not Palermo (especially with the current "heat wave").
Just don't wear a "gimme" cap (straight, canted left or right or reversed)and flip flops....