By legal 7th delivery, I mean the umpire not realising that 6 balls have been bowled and so the bowler throws the 7th delivery. I know that in such a case the extra ball is considered to legal. But if this 7th delivery is a no ball and then the umpire realises that there has been a mistake in counting, does ICC allow a free hit to be given?
Laws of cricket would apply, in Law 17.5 if an umpire miscounts, they will call over even if the ball was not a legal delivery.
17.5 Umpire miscounting
17.5.1 If the umpire miscounts the number of valid balls, the over as counted by the umpire shall stand.
17.5.2 If, having miscounted, the umpire allows an over to continue after 6 valid balls have been bowled, he/she may subsequently call Over when the ball becomes dead after any delivery, even if that delivery is not a valid ball.