You can play as whatever class you want and switch at will between waves. After switching class you can refund the money spend on other classes to spend it on your new class.
At the end of a level you will go back to the menu and chooses another map to play on meaning character wise you will start a fresh selecting a new class.
MVM needs good team work and by picking a class ahead of time you are already negatively impacting your chances. You need to look at what other players are playing as and choose a class to suite the situation.
The 3 classes you have listed and however some of the most useful. The pyro is good at taking out tanks. The soldier is a decent damage dealer. and the engineers sentry's are handy against large waves of weaker enemies.
If you fail a wave you can keep trying till you complete it. The only issue here is people tend to start leaving the game after a few losses.