Can ordinal numbers be generalized to arbitrary classes? The following is an obvious potential, albeit incomplete, method of generalization. One class paired with an ordering $s$ would be of the same order type as another $t$ iff there exists an order-preserving bijection (with bijections generalized to arbitrary classes) between $s$ and $t$. Similarly, $s \leq t$ iff there exists an order-preserving injective function (with injective functions generalized to arbitrary classes) from $s$ to $t$.
Are ordinal numbers even able to be generalized to all classes? Can bijections and injective functions be generalized to arbitrary classes? Am I making some other mistake or have some fundamental misunderstanding?

Sure!
First of all, note that this is easy in case we work in a class theory like NBG, where we can directly talk about things. In ZFC it's a little messier$^*$, but we can still talk about specifics.
I don't think there's a lot known about class-length well-orderings, but let me point you towards a few MO questions you might find interesting:


*

*https://mathoverflow.net/questions/144116/what-is-the-order-type-of-l-with-godels-well-ordering?lq=1

*https://mathoverflow.net/questions/116590/what-is-omega-1ck-mathsford

*https://mathoverflow.net/questions/189000/can-there-be-ordinals-larger-than-those-contained-in-ord-and-if-so-can-they-be?rq=1

$^*$Actually, the "right" theory should probably be something like ZFC+V=L that can prove that there is a well-ordering of the universe - otherwise, for instance, I don't see how to prove that any two class-length well-orderings are comparable.
