How can I compare the contribution of two predictors in two different sorts for machine learning algorithms? I'm new to machine learning and try to clarify my problem in research. I just wonder if I can compare the importance of two different variables in two different sorts. For example, A and B are two variables that I want to compare their contribution to ML accuracy. The rest of the variables (like C, D, and E) for each sort are the same.

If I got the results that the rest of the variables (C, D, and E) contributes more (obtain a higher importance score) in the model predicted by A and the rest, can I just say B performs better for ML and its contribution is more significant than the model with A and the rest?
No you can not.
You are forgeting about variable interactions (C-A,D-A,E-A, etc...)  that could favor A.

You could answer following qestion: If I were to measure information in my variables via variability how would I proceede? For example PCA

The more information you have in the variable(predictor) the higher the chance that it will contribute more to accuracy