This has come up in two separate threads in the last day or so, so I thought it would be a discussion-worthy topic.
There is a general assumption that there are no-fraternization policies in place in Starfleet. These are often a part of fics that involve Archer, Trip, and/or T'Pol in romantic situations and relationships.
However, in "Breaking the Ice,' Archer tells the school children that dating on the ship isn't against the rules, just problematic due to lack of privacy.
We know Kirk and Picard both have officiated weddings of crew members.
And recently rewatching early Voyager episodes, when Janeway and Chakotay are discussing the topic, Janeway says something to the effect of (I can't recall verbatim) "Starfleet has never gotten involved in people's personal lives."
It was clear from the Voyager episode that what bugged Chakotay was the indescretion--two people making out in a turbolift. Janeway wasn't bothered by the relationship itself, but was more inclined to have people keep it on the down-low when on duty and in public.
When Chakotay asked her what *she* intended to do about pairing off, she first says "That's a luxury I don't have," then kind of shifts the reason to being about Mark and not her command.
So, I know in the real navy, there are rules governing relationships. You can't be more than so many steps in rank apart from each other, and I think someone told me that a married couple can't serve on the same ship (though I don't know if that's true.)
Keep in mind, Star Trek only has to follow its own internal logic, not necessarily that of our world. So that said, do we really believe that the captain (or his senior officers, for that matter) are forbidden to have shipboard relationships? Or is that something that, while permitted, most people just kind of avoid by convention as a "bad idea"?