One could argue that Hurwitz's formula boils down to two simple facts:

- If $f:X\to Y$ is an étale morphism, then $\omega_X=f^*\omega_Y$.
- If $f:X\to Y$ is dominant, then $\omega_X\supseteq f^*\omega_Y$

"1." is a trivial consequence of an equivalent characterization of being étale, namely that $f$ is flat and $\Omega_{X/Y}=0$ (see Hartshorne, Ex.III.10.3).

"2." follows from taking any local section of $\omega_Y$ and realizing that pulling it back via $f$ (that is, substituting the change of variables given by $f$ into the local variables) one gets a regular form again.

If $f$ is as in the question, then it is étale away from the ramification locus essentially by the definition of the ramification locus (which is a divisor by purity as pointed out by Christian). Then "1." implies that $K_X=f^*K_Y+R$ for some divisor supported on the ramification locus and "2." implies that $R$ is effective.

The actual coefficients of $R$ and the ramification indices depend on local information. Localizing at the general points of the irreducible components of the ramification locus reduces the question to the case of curves.

Regarding the question of the degree of the canonical divisor, I'd say something different than what has been said above. True, a notion of degree as in the case of curves does not exist in general, but if we examine what that notion on curves really is we may be able to come up with similar notions that could work just as well.

If you think about it, the main reason we can define a degree of divisors on curves is that there exists a single (effective) divisor, namely a point, such that every divisor is numerically equivalent to a multiple of this one and then we just call that multiple the degree of the divisor.

In other words, if $X$ is such that the group of divisors modulo numerical equivalence is $\mathbb Z$, then one could define degree of $D$ as the number it maps to when considered via this isomorphism. This is what happens for example when we talk about the degree of a hypersurface in $\mathbb P^n$.

Another way of thinking about degree is that it is an intersection number. It is customary to define the degree of a projective variety (with respect to a given projective embedding) by the number of points in an intersection of the given variety with a complementary dimensional linear subspace in general position. For a divisor this would mean intersecting with a line in general position (or just take the intersection number with a line).

Of course, a general variety will not contain a line, but one may do the following: Fix an ample divisor $L$ and define the degree of a divisor as $D\cdot L^{n-1}$ where $n=\dim X$. In many cases this will work fine and whatever you would use the degree of the divisor, this would give you the same framework.

So, I would say that the problem with the degree of the canonical divisor is not that it doesn't exist, but that in general any definition of a degree of a variety involves some choices and hence one may end up with more than one notion of degree. However, with respect to Hurwitz's theorem, if you want to use degree to compare $K_Y$ and $K_X$, you should still be able to get something useful, since all you have to do is to make sure that you use compatible notions of degree on $X$ and $Y$. For instance, if you follow the degree determined by an ample line bundle, then just take one on $Y$, pull it back to $X$. Since $f$ is finite, this will be ample and the two notions given by the two line bundles will be compatible. In fact, go ahead and write down the degrees of the divisors in the Hurwitz formula this way. You will end up with a similar (but different!) formula. The degree of $f$ will enter also via the pull-back of the ample line bundle, so perhaps to get a more familiar formula, you would have to divide all degrees on $X$ by the degree of $f$ (or multiply them by it on $Y$).

The obvious downside of defining degree this way is that it is not portable. You can define it in a given situation and try to make you definitions on different objects to be compatible, but you cannot expect to get any numerical results that remain true in a different situation. For instance you cannot
say absolute things like "the degree of the canonical divisor is $2g-2$".