Technically, you could have any class extend any other class. However, good OOP design demands that there be an "is-a" relationship between a class and any other classes that may inherit from it. This is one reason why OOP is so versitile as it allows for easy expndability and extensibility.
The classic example given is that of the Shape class. Conceptually, it's not too hard to envision that a Square or a Circle are both Shapes (a square "is-a" shape, a circle "is-a" shape), yet they look quite a bit different. I believe that the lack of the same "is-a" relationship between stars and planets is the reason for the unexpected answer on the Khalid question. There's no technical reason why you can't have a planet inherit from a star, there's just not a good conceptual one.