I know that Zorn's lemma or its equivalent axiom of choice and so on can be applied to a set - but I am not sure if it can be applied to a class.
I think I've seen an usage of axiom of choice to a class, but I am not sure if I really did. So the question comes.
Let me try and be more accurate when you say "apply Zorn's lemma to a class":
This would be Zorn's lemma for proper class, and it is equivalent to the axiom of choice for class, which is called "the axiom of global choice". To be more explicit about this:
Similarly to the case of the usual axiom of choice, this is equivalent to the well-ordering principle with a slight twist:
(It is enough to require this only for the entire universe, of course; and in fact the global choice thing too - the universe except the empty set).
All the usual proofs work out just fine.
Now it is important to add that these three equivalent principles are stronger than the axiom of choice/Zorn's lemma/well ordering principle for sets. Indeed it is consistent with $\sf ZFC$ that there is no well-ordering of the entire universe, and similarly there is no choice function from all non-empty sets, and there is a partially ordered class where every chain is bounded but there is no maximal element.