Some medical conditions require special accommodations and you should by all means make the needed adjustments, including practicing in a supine position if needed.
But the reality is that if you sit still long enough in ANY posture, discomfort will arise. In my classes it is always acceptable to change your posture to relieve pain. Standing in place for a few minutes usually works better than trying to shift your legs around a little bit. A change in posture should be done as slowly and quietly as possible, partially to avoid disturbing others if you are in a group setting, but more importantly to help you make the transition with as much awareness as possible on the changes that take place in your perception. Make the change in posture an opportunity to deepen your meditation.
So it is always acceptable to change positions, but should you? Some physical and psychological pain is an inevitable condition of being a human being. One benefit of mindfulness meditation is learning a different way to relate to pain that causes less suffering. Many people suffering from chronic, intractable pain turn to mindfulness meditation for relief. This new way of relating to pain involves letting go of resistance, of the internal struggle against the sensations of pain, and instead greeting the discomfort with awareness and acceptance.
The discomfort that comes with prolonged sitting meditation creates an opportunity to practice this new way of relating to pain in manageable doses. No matter how fortunate our life may be, we almost certainly will eventually experience physical and/or psychological pain that overwhelms our normal coping skills. Working with the small doses of discomfort that come with meditation practice acts as a kind of innoculation for the inevitable large doses that will likely visit us at some time.
So there is benefit to working with discomfort using the tools of mindfulness rather than simply trying to avoid it by moving. But we don’t want to turn meditation practice into a white-knuckle test of endurance. In general, working with discomfort will be fruitful as long as you are able to maintain concentration and equanimity. When concentration or equanimity start to break down due to the intensity of the discomfort, it is time to move.
A final note: any discomfort from sitting should go away within a few minutes after standing up. If pain lingers more than an hour after finishing the session, you should give some thought to changing your meditation posture to avoid injury.