What happens to a machine learning technique (specifically Decision Tress and Logistic Regression) if the validation dataset has a new category?
There are no categorical value support in the decision trees used in scikit-learn. Either the values are just numbers, or they have been one-hot-encoded.

One-hot encoding with an unseen input value will change the width of the feature array, which will give an error when running decision_tree.predict(X).

Without one-hot encoding the output will most likely be the same as for the value closest to it. Because the tree learns rules on form feature[2] &gt; 3 to distinguish say a value of 3 from a value of 4 (during training). So a value of 4,5,6... etc will be treated the same way.
There are no feature[2] &gt; 4 or feature[2] &lt; 5 rules, since there was no data for that to cause splits that could be evaluate/optimize during training.

So if you want an error also when not using one-hot-encoding, you will have to check the range of features before you pass it to the Decision Tree.