Uniform today is either uniform or its exact opposite for very practical reasons. On one hand, if everybody wears the same style, it makes logistics easier, plus it pushes people off their personal pedestals and down to the same dirt with everybody else (which is a crucial factor in the early stages of training a conscript army, and in keeping professional soldiers from becoming uncontrollable later on). On the other hand, a hierarchical organization needs to be reinforced with symbology (especially when it's not a close-knit meritocracy, and armies generally never are), and a battlefield organization needs brightly and blatantly visible symbols as subtlety doesn't carry well through dirt. Emphasizing the specialties
of the specialists and the privileges of the privileged is a must.
Worf wearing a sash is probably akin to Scotty or a Scotsman of today wearing a kilt as a uniform variation: it's a historical privilege that's good for morale, because it wouldn't do to have the Scots rebel or the only Klingon in Starfleet not be happy with his lot.
Troi wearing what she wears is more likely a psychological experiment of some other sort; most starship counselors might be civilians. Dunno. All I know is that Jellico made a big mistake in putting her in a uniform for the meeting with the Cardassians. Having her choose from her usual wardrobe would certainly have insulted the Cardassians more...