I doubt it was either since both were open racists.
What you said.
Of course, in Marx's time racism was taken for granted, and viewed as scientific, modern and all other good things. Only fruitcakes were non-racist.
Hitler certainly wouldn't have said it, as he built his entire ideology on racism.