Swearing in the science fiction genre is a time-honored tradition. Sometimes it is done poorly, sometimes well, sometimes to be serious, and sometimes for comic effect. I've perused a number of great posts and articles, a few of which I discuss below, that deal with the subject.
First of all, sci-fi has a tendency towards gritty subject matter. This is certainly not always the case, but as a genre, there is a general tolerance for some varying amount of tough topics like sex, profanity, torture, crime, and whatnot. So swearing in one form or another is not uncommon.
The general trick with sci-fi is that we are often writing in times, worlds, and universes other than our own. In some cases this means current standard human swear words are still appropriate, but like as not, things are different enough in the setting in question that one would not expect the swear words to be the same.
Of course, one would not expect any of the words to be the same. That is, we imagine our characters are actually speaking a language other than English. So technically, since all of this is translated, one might assume the swear words would be translated into their most likely English equivalent, as well. But as both a reader and writer of sci-fi, I know you can get a lot of leverage from making up likely and believable words, including swear words, that will give your story a 'realistic' edge.
For example, I noted a book called "Brave New Words" which discusses all the great sci-fi words that have been made up over the years. A post on the OUPblog contained an excerpt from that book targeted specifically at manufactured profanity.
And here's a post on made-up swearing currently in the genre which can be found at io9 (using the same photo I have here because it is very cool). The post mentions an old favorite from Mork and Mindy - Shazbot. Admitting that memory places me pretty easily on the age meter, I know. But using that word was an excellent way to create both humor and a sense of the difference between Mork and the humans.
Personally, I think making up good words for use in sci-fi settings is a great skill, and those who are good at it can add a layer of complexity to their writing that can really make a story shine.
Image is of a license plate with the word 'frak'. Some believe it was originally a Battlestar word, while others give credit to the old Star Trek for this one. Either way - made up swears in sci-fi are a beloved part of the genre. http://www.flickr.com/photos/sometoast/ / CC BY-SA 2.0