The angular velocity $\vec{\omega}$ lies along the axis of rotation. And the angular momentum $\vec{J}$ is the cross product of $\vec{r} \times \vec{p}$. Which according to me should also lie along the axis of rotation. But I read in a book that the direction of angular momentum vector and angular velocity vector are not the same. Why is it so?
3 Answers
The formula you have specified $\vec{L} = \vec{r} \times m\vec{v}$ is the definition of angular momentum of a point-like particle which respect to a point P. In this case of course angular momentum and angular velocity have the same direction. When dealing with rigid bodies (assemblies of many point-like particles), the correct full angular momentum is proved to be:
$$ \vec{L} = I \vec{\omega} $$ where in general $I$ is a tensor (a matrix for simplicity) depending on shape and mass distribution of the rigid body, called inertia tensor. It is possible, in general, that once you choose a reference frame (say with $\omega$ parallel to the $\hat{z}$ axis), the inertia tensor could be diagonal or not in that basis. If it's diagonal, then $\vec{L}$ is parallel to $\vec{\omega}$, otherwise it is not. As an example, you can consider a cylinder forced to rotate about an axis which is not parallel to any of its principal axes of symmetry.
I hope I've answered your question properly; if not, please ask for details.
The answer provided by @Matteo is a correct explanation. However, I wanted to expand on the supplied equation $$\mathbf L=\hat I\boldsymbol\omega$$ where $\mathbf L$ is the angular momentum of the rigid body, $\hat I$ is the moment of inertia tensor, and $\boldsymbol \omega$ is the angular velocity vector of the rigid body. If we write this equation out explicitly for three dimensions we have:
\begin{equation} \begin{bmatrix} L_x \\ L_y \\ L_z \\ \end{bmatrix}= \begin{bmatrix} I_{xx} & I_{xy} & I_{xz} \\ I_{yx} & I_{yy} & I_{yz} \\ I_{zx} & I_{zy} & I_{zz} \\ \end{bmatrix}\cdot \begin{bmatrix} \omega_x \\ \omega_y \\ \omega_z \\ \end{bmatrix} \end{equation}
Each element of the moment of inertia tensor is given by $$I_{jk}=\int\rho(\mathbf r)\left(r^2\delta_{jk}-jk\right)\text dV$$ where $\delta_{jk}$ is the Kronecker Delta and $\rho$ is the mass density function. For example: $$I_{xx}=\int\rho(\mathbf r)(y^2+z^2)\text dV$$ $$I_{xy}=-\int\rho(\mathbf r)xy\ \text dV$$ and so on.
So now let us ask, along the lines of your question, what must be true so that $\mathbf L$ and $\boldsymbol\omega$ point in the same direction? Well, if two vectors point in the same direction, then it must be that one is a constant multiple of another. Therefore, for some constant $\lambda$ we must have $$\mathbf L=\lambda\boldsymbol\omega$$ Using our first equation this must mean that: $$\hat I\boldsymbol\omega=\lambda\boldsymbol\omega$$
This is an important type of equation seen a lot in linear algebra and its applications. Mathematically, this means that we want $\mathbf\omega$ to be an eigenvector of $\hat I$ with an eigenvalue of $\lambda$. Physically, this means that if we rotate our object about an axis such that $\hat I\mathbf\omega=\lambda\mathbf\omega$ (these types of axes are called "principle axes") then our angular momentum and angular velocity vectors will point in the same direction. If this is not the case, then our two vectors will point in different directions.
It is worth mentioning that in typical introductory physics classes we are usually only operating with coordinates aligned with the principle axes, which coincide with axes of symmetry for the volumes that are usually considered (this makes our moment of inertia tensor a diagonal matrix). For example, when you see that the moment of inertia of a disk is $\frac12MR^2$, what this really is telling you is $I_{zz}=\frac12MR^2$, and we only consider the disk that rotates about this axis such that $\boldsymbol\omega=\omega_z\hat z$. Therefore, our equation becomes
\begin{equation} \begin{bmatrix} L_x \\ L_y \\ L_z \\ \end{bmatrix}= \begin{bmatrix} I_{xx} & 0 & 0 \\ 0 & I_{yy} & 0 \\ 0 & 0 & I_{zz} \\ \end{bmatrix}\cdot \begin{bmatrix} 0 \\ 0 \\ \omega_z \\ \end{bmatrix}= \begin{bmatrix} 0 \\ 0 \\ I_{zz}\omega_z \\ \end{bmatrix} \end{equation}
So, in other words, $\mathbf L=I_{zz}\omega_z\hat z=\frac12MR^2\omega_z\hat z$.
The physical quantity which connects angular momentum $\mathbf{J}$ and angular velocity vector $\boldsymbol{\omega}$ is the moment of inertia. However, this quantity is not a scalar. A scalar would not depend on the coordinate system. In the following it is assumed that the rotation axis will be along the z-direction. Then look at the following example: Turn a cylinder of uniform mass density and length $l$ around its symmetry axis. In this case the moment of inertia is
$$I =\frac{1}{2}mr^2$$
where $m$ is the mass of the cylinder and $r$ its radius. Now turn the cylinder so that the rotation axis is $90^{\circ}$ perpendicular to the symmetry axis. The moment of inertia is not the same.
$$I =\frac{1}{4}mr^2 +\frac{1}{12}ml^2$$
Turning the cylinder again so that the rotation axis (z-axis) is the third axis of the cylinder (also perpendicular to the symmetry axis) is identical to the second case. So depending on the orientation of the cylinder in the chosen coordinate system the moment of inertia of the cylinder is different.
This behavior of the moment of inertia can be expressed by the following diagonal matrix (here it is assumed that the symmetry axis of the cylinder is along the z-direction.
$$I = \left(\begin{array}{ccc} \frac{1}{4}mr^2 +\frac{1}{12}ml^2 & 0 & 0\\ 0 & \frac{1}{4}mr^2 +\frac{1}{12}ml^2 & 0 \\ 0 & 0 &\frac{1}{2}mr^2\end{array}\right)$$
Nevertheless in these cases for each chosen axis -- called principal axis --$\,\,\,\boldsymbol{\omega}$ is still parallel to $\mathbf{J}$.
The matrix form of $I$ already suggests it: The moment of inertia is actually a tensor and only if the coordinate system is chosen to coincide with the three principal axis of a given mass distribution (here a cylinder) it can be written in form of a diagonal matrix. If this is not the case, imagine a rotation axis (still identical with the z-axis) which is inclined $\neq 90^\circ$ to one of the principal axis of the body (here a cylinder), the matrix $I$ becomes non-diagonal and the relationship between $\boldsymbol{\omega}$ and $\mathbf{J}$ becomes more general:
$$ \mathbf{J}= I \cdot \boldsymbol{\omega}$$
where the $\cdot$ is a matrix product multiplication. In this case $\,\,\,\boldsymbol{\omega}$ is no longer parallel to $\mathbf{J}$.