The uniform code of the 23rd century Federation Starfleet permitted some personalization of the uniform. Lieutenant Uhura and Dr. Ann Mulhall wore earrings. Scotty wore a kilt as part of his dress uniform in the 2260s. Native American personnel were permitted to wear traditional jewelry with their duty uniforms in the 2270s. (TOS: "The Savage Curtain"; Star Trek: The Motion Picture)
In the 24th century, Worf was permitted to wear his baldric as part of his duty uniform, but Ro Laren was initially forbidden to wear her Bajoran earring as part of hers. (TNG: "Encounter at Farpoint", "Ensign Ro") Although Ro was eventually permitted to wear her earring, Bajoran crewmembers on board some other starships were not allowed to do so initially, although at least one Bajoran on the Enterprise-E wore the earring. In addition, elaborate headbands and jewelry were in violation of the dress code, though simple headwear, such as simple headbands and Ferengi headdresses were permitted. (VOY: "Learning Curve"; TNG: "The Next Phase"; DS9: "Paradise Lost", and more)
In Star Trek Online, to allow for the game's massive character creation design, additional information was added in the game to reveal that Starfleet relaxed the dress code for Starfleet uniforms to the point that, as long as an officer wore the colors of their respective department, they could wear any sort of uniform they wished, which allows players to not only wear uniforms from the past few decades, but uniforms from the past few centuries, alternate universes and timelines.