Hmm the two can, and have been combined but it depends on if you are talking about Art direction or Storyline. The two are uncommonly (but by no means rarely) combined in Art direction but in storyline one usually is dominate over the other.
Classically speaking, Science fiction stories and Fantasy stories operate on different principles. In science fiction the stories are usually centered around one or more of the following:
1. The impact of technology on people/society/the human condition and vice versa.
2. How the use of logic, wit, and planning can overcome problems facing humanity. Asimov loved this one.
3. Using exotic locations and/or aliens as 'the other' to discuss and explore real world situations in a way that is both apparent on closer inspection but distanced enough that it doesn't make the reader feel uncomfortable (i.e. using aliens to discuss racial/gender/political issues).
Fantasy, however, is more about escapism, willpower, faith and the concept of 'goodness'. This is not to say that Science Fiction has no elements of these things, they are just more subdued and often defer to the above points. In fantasy its more about how the problems of the world can be solved though toughing things out and believing that something better is out there. However, it can also frequently overlap with #3 on my science fiction list, except through use of different races (like elves and goblins) rather than aliens.
Yet, the different races in fantasy usually embody different aspects of humanity whereas aliens usually represent subgroups of humanity or serve as a mirror to how humanity deals with 'the other'. In an example of the second definition, they (the aliens) are bizarre and the real meaning of the story wouldn't that they are weird, it would be about how humans deal with this weirdness and what it says about us.
The main issue in merging the two genres within a single storyline lies in the divide in how fantasy and science fiction view problems. To fantasy, problems are typically not entirely solvable by humanity. WE cannot overcome our problems through sheer technology nor though careful planning, that there is an uncontrollable element to life. This is why fantasy classically has some magic to it, its something that is unreal and requires faith, and willpower to use. Science Fiction typically sees its problems as being both knowable and solvable. Here it is technology that solves our problems, failing that (or if technology is the culprit) then it is logic and careful planning that saves the day. While science fiction does have an element of "just take our word that this tech works" it?s more important to realize that technology in itself is a very human thing to create, posses and command, whereas magic is usually viewed as something that nature provides and it?s just on loan to humanity.
Yup.