This can be easily done in slow/medium pace deliveries. Consider a batsman getting bowled in a no-ball or a free-hit ball and the ball remains near the batsman.
Is it allowed to hit the ball with the bat/leg by the batsman to get runs?
This situation comes under the law 37 (Obstructing the field). (emphasis mine)
So in the given situation once the ball is bowled (here either no ball or free hit), it is in play irrespective of the ball touches the bat until the umpire declares it a dead 1. So if the batsman hit the ball after he gets bowled, he is actually obstructing the field because fielders (mostly the bowler himself in such situations) rush to the ball to take it to prevent batsmen taking runs. So the batsman who is hitting the ball is out Obstructing the field.
1. Normally the ball becomes dead after it is thrown to the keeper and batsmen are into the crease or a batsman is out