I've heard people say that the cheese used in pizzas is not suitable for many other things and for this recipe you need to have this particular cheese. Is there some broad principle as to which cheese should be used and where??
I would imagine that one would use the cheese local to the dish being made.
For example, for pizza, one would use (fresh) mozzarella; or for the traditional Tartiflette, one will use Reblochon cheese or use Cheddar for a Welsh Rarebit.
You could substitute cheeses in recipes, but the final taste or texture might not be the same as you would have if using the "proper" cheese, or worse could ruin a dish.
For example, I would never use Camembert for a Cacio e Pepe pasta dish.
Cheeses have different characteristics, some will melt, other will not, some must be eaten fresh, some can be aged.
Normally, you should use a similar cheese when trying to substitute (Grana Padano vs. Parmesan vs. Romamo)
But feel free to experiment and try different cheeses in different dishes.