how to handle different categorical values in train and test dataset?
Whether to remove the dimension or not would wholly depend on the kind of data you're working with and how important is the feature for your modelling task.
What you need to ask is are the labels predefined? And by that I mean is there any particular upper bound to the kind of labels you're receiving? If yes, you could simply use label encoding from sklearn. After which I'd recommending doing some feature analysis and getting the feature importance score for that label and then decide if you want to discard it or not.
Regarding your second question, you need to encode the labels before you train your model.