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 and sporran 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", et al.)
When Captain Edward Jellico temporarily took command of the USS Enterprise-D in 2369, he requested that Counselor Deanna Troi wear a standard uniform, as he preferred a more formal atmosphere on the bridge. (TNG: "Chain of Command, Part I")
Customization of the uniform was apparently permitted "at the captain's discretion", since no one ever objected to Worf's sash, and Picard eventually permitted Ro her earring, and later a simple command red headband.
In Star Trek Online, to facilitate player character customization, Starfleet is established to have relaxed its dress code so that any uniform was allowed so long as it bore the appropriate department color. Thus, players can wear not only uniforms from the past, but also from alternate universes and timelines.