Frak actually merits its own Wikipedia entry and there is a good bit of history for this fictional word. In the original BSG from the 1970's, it was spelled frack and used sparingly in the show (I've seen about 5 episodes of the original). In the new series, it was shortened to frak because the writers wanted it to be a four-letter word.
It also ties into a larger article about profanity in science fiction. The fact that this is a Wikipedia article on its own was enough to make my mind-numbingly dull day better. One major point it makes is that by having fictional profanities, they can communicate how the characters would normally talk (because soldiers are Orbit gum ads waiting to happen) and still make it past the censors. Firefly did the same thing with "goram" but it doesn't appear to be as widely recognized. Although props to this blog which is entitled "Goram Motherfrakker" This is also a trick used in the young adult novel The Maze Runner where the young men of the maze create their own profanity.
There is one thing I'm wondering. Anytime I've seen frak used on it's own, it only has 1 K but anytime there are letters after it (motherfrakker, frakkin') there are 2 Ks. Why is that and how was it decided? Is there some sort of sci-fi linguistics involved?