The Doctor and Companions arrive at a strange place, a seemingly deserted building full of artifacts. They had a mishap during landing which lead to their being disjoint from time. In the building they eventually see people but the people cannot see them. Curious as to what's going on they explore further, and then find a room containing the TARDIS and they're shocked to see themselves on display. The realization comes, they're seeing their own future and the question comes, how do they avoid this future? Is the future predetermined and there is no way to avoid it? Or are they able to, having been informed of the future, take steps to avoid the future? Or are any steps they take part of the predetermined steps which will take them to their future even as they take those steps to avoid the future they already know about?
Very good questions. Along the way they meet rebels who are fighting invaders. It seems the space museum was established by a race which had conquered their way to a huge empire spanning galaxies, and they had taken over this specific planet to run it as a museum showing their victories. But the original inhabitants were resisting these invaders and the Companions joined with the resistance.
Eventually they do avoid their future, they do not become exhibits in the museum. Or, did they avoid their future? They did after all arrive in their future, but it was a future different from the one they foresaw.