Dummy classifier?

Still don’t understand why we used a dummy classifier prior to OneHotEncoding

Encoding is implemented to the features, not the target. As a dummy classifier ignores the input feature values passed as the argument to fit and predict (internally called during the cross-validation), having the data encoded or not does not make any difference.