Tensoring a sheaf isomorphism from Hartshorne's Algebraic Geometry Let $Y$ be a nonsingular subvariety of codimension 1 in a nonsingular variety $X$ over a field $k$. Write $\omega_X$, $\omega_Y$ for the canonical sheaves of $X$ and $Y$, and $\mathscr{L}$ for the sheaf corresponding to $Y$.
Proposition 8.20 in Chapter II.8 of Hartshorne's Algebraic Geometry states that in this case
$$ \omega_Y \cong \omega_X \otimes \mathscr{L} \otimes \mathscr{O}_Y  \, .$$
Naively it appears to me that this implies
$$ \omega_Y^{\otimes n} \cong \omega_X^{\otimes n} \otimes \mathscr{L}^{\otimes n} \otimes \mathscr{O}_Y  \, .$$
My question is whether it is legitimate to take tensor products of both sides like this in such an isomorphism. (Those on the left must be understood as $\otimes_{\mathscr{O}_Y}$, and those on the right as $\otimes_{\mathscr{O}_X}$.)
 A: Yes this is fine; Let $f\colon Y\to X$ be the closed immersion that realizes $Y$ as a subvariety of $X$. Then, the formula becomes $\omega_Y = f^\ast(\omega_X\otimes\mathcal{L})$. Since $f^\ast$ always induces a group homomorphism between the Picard groups $\phi\colon\operatorname{Pic}(X)\to\operatorname{Pic}(Y)$ (this is Ex. II.6.8 in Hartshorne), you get 
$$\omega_Y^n = \phi(\omega_X\mathcal{L})^n = \phi((\omega_X\mathcal{L})^n)=\phi(\omega_X^n\mathcal L^n).$$
Note that this is an equality of elements in $\operatorname{Pic}(Y)$, we are not comparing apples and oranges.

Regarding the question if $f_\ast\omega_Y=\omega_X\otimes\mathcal{L}$:
Nope. Take $X=\Bbb P^2$ and $Y$ a smooth elliptic curve cut  out by $f\in\Bbb C[x,y,z]_3$. Then, $\mathcal L=\mathcal O(3)$ and $\omega_X=\mathcal O(-3)$, so we have $\omega_X\otimes\mathcal{L}=\mathcal O_X$. Hence,
$$\omega_Y=f^\ast(\omega_X\mathcal L)=f^\ast(\mathcal O_X)=\mathcal O_Y.$$
But $f_\ast\omega_Y=f_\ast \mathcal O_Y$ is not isomorphic to $\omega_X\otimes\mathcal{L}=\mathcal O_X$: The coordinate ring $S=\Bbb C[x,y,z]$ is not isomorphic as an $S$-module to the quotient $S/(f)$. 
Another perspective: Because $f$ is an immersion, you have $f^\ast\circ f_\ast=\operatorname{id}$. Think of the example above: Considering $S/(f)$ as an $S$-module and then tensoring it with $S/(f)$ again changes nothing. So, you have
$$
f^\ast(f_\ast \omega_Y) = \omega_Y = f^\ast(\omega_X\otimes\mathcal{L}).
$$
Now, if $f$ is dominant (and projective), then $f^\ast$ is injective, and this is about the only case where this happens to my knowledge. There are certainly other situations (the world of algebraic geometry is quite colorful), but my intuition was always that $f^\ast$ becomes injective when $f$ is dominant. Closed immersions are quite the opposite, though.
A: Yes. Let me write $\iota:Y\to X$ for the closed immersion. Then, as you say, you have $$\omega_Y\cong \iota^\ast(\omega_X\otimes_{\mathscr O_X}\mathscr L)$$ and since pullback commutes with tensor products you have $$\omega_Y^{\otimes n}\cong \bigl(\iota^\ast(\omega_X\otimes_{\mathscr O_X}\mathscr L)\bigr)^{\otimes n}=\iota^\ast\bigl(\omega_X^{\otimes n}\otimes_{\mathscr O_X}\mathscr L^{\otimes n}\bigr),$$ and this is your formula as $\iota^\ast(-)=(-)\otimes_{\mathscr O_X}\mathscr O_Y$. If you write this in the language of divisors, it takes the form $$K_Y=(K_X+Y)|_Y\,\,\,\Rightarrow\,\,\,nK_Y=(nK_X+nY)|_Y.$$
