As far as we saw on the show, people were allowed to do whatever they wanted in their private lives as long as it was not interfering with their duties.
So, as long as "Tom" didn't hit on the sexy science officer while plotting a course, or wasn't caught, ahem, in a precarious situation in the ship's public areas, I don't think that our Starfleet regulations have much to say against his behaviour.
Then again, I have nothing official to back it up... but given that we've seen almost every Trek Starfleet character engaged at least once in a romance, I think such a regulation would have cropped up at least once.
On the other hand, if he really was socializing on duty, then I guess there should be some sort of regulation about it that a "by-the-book" captain would be only too glad to enforce.
"The main difference between Trekkies and Manchester United fans is that Trekkies never trashed a train carriage. So why are the Trekkies the social outcasts?"
Terry Pratchett