LAW 35 (HIT WICKET) -
(a) The striker is out Hit wicket if, after the bowler has entered his
delivery stride and while the ball is in play, his wicket is put down
either by the striker’s bat or by his person as described in Law
28.1(a)(ii), (iii) and (iv) (Wicket put down).
either (i) in the course of any action taken by him in preparing to
receive or in receiving a delivery,
or (ii) in setting off for his first run immediately after playing or
playing at the ball,
or (iii) if he makes no attempt to play the ball, in setting off for
his first run, providing that in the opinion of the umpire this is
immediately after he has had the opportunity of playing the ball,
or (iv) in lawfully making a second or further stroke for the purpose
of guarding his wicket within the provisions of Law 34.3 (Ball
lawfully struck more than once).
(b) If the striker puts his wicket down in any of the ways described
in Law 28.1(a)(ii), (iii) and (iv) (Wicket put down) before the bowler
has entered his delivery stride, either umpire shall call and signal
Dead ball. More Details
Suppose a batsman clobbers a ball out of the park and while the ball is in the air inside the boundary, he falls onto his wicket and is out. Shortly after the ball crosses over and falls outside the boundary.
In this case the ball will be dead as the ball has passed the boundary rows so the batsmen could not be declared OUT.
LAW 23 (DEAD BALL)-
(a) The ball becomes dead when
(i) it is finally settled in the hands of the wicket-keeper or of the
(ii) a boundary is scored. See Law 19.3 (Scoring a boundary).