Can you please explain why isn't nitrobenzene reduced to aniline but turns out as azobenzene on reaction with LiAlH4? Please explain the mechanism.
It is entirely possible you form aniline, but it gets consumed. During the reduction nitrosobenzene would also be formed, and Delmagro et al.  report that in basic solution the aniline can couple with the nitrosobenzene to give azobenzene. This coupling depends on the nitrogen in aniline acting as a nucleophile, so under acidic conditions as in a tin/hydrochloric acid reduction it would be suppressed (and thus aniline preserved/protected) by protonating the aniline. See also this answer.
1. Jacir Dalmagro, Rosendo A. Yunes, Edesio Luiz Simionatto. "Mechanism of reaction of azobenzene formation from aniline and nitrosobenzene in basic conditions. General base catalysis by hydroxyide ion". Journal of Physical Organic Chemistry 7 (8), 399-402. https://doi.org/10.1002/poc.610070803