Who says they aren’t to code? Maybe they are allowed to implement accents from their native cultures? I mean we are talking about the “woke” starfleet here.
In Worf's case, that is actually true. His sash is a culturally significant item for Klingons, displaying his house sigil for example. The same is true for Ro's earrings though. And since Worf got an allowance, Ro should get it, too (which Picard eventually grants. But Worf never got that remark from Riker).
Deanna however just wears civil garments.
There also was a bunch of selectivisim going on: by allowing the only klingon in Starfleet, a son of a major house, wearing the sash, and then having him posted prominently on board the bridge of their flagship, was a power move.
Cptn Janeway: "Ensign Kim, what the hell are you wearing?"
Kim: "Oh these! Tom was telling me about them. They were all the rage in 1900's America and were worn by people seen as both tough and cool. They're called 'Assless Chaps.' I have to admit it was a little weird sitting down at first but I'm a huge fan of the cooling factor!"
Janeway turns to Lt. Paris
Tom's barely contained laughter waters his eyes trying not to lose it
Low ranking officers. OCS cadets are officers. Technically, a staff sergeant with 15 years of career experience has to salute a pimply teen-ager who's still in school. There's a difference; rank and experience means more than whether you have a pip or not.
I could see Tori being allowed to wear more casual attire as a way to help put the crew at ease during sessions. But as a bridge officer and member of senior staff, yeah she should be in uniform