Want to get 20 KHz frequency but I am getting 31 KHz frequency on arduino

Code is just not right to be honest.

 TCCR2B &= ~ _BV (CS22); // cancel pre-scaler of 64
  TCCR2B |= _BV (CS20);// no pre-scaler

You have not even set a Wave Generation Mode.
There are further issues...but maybe have a look at an example of using Timer 2 for PWM before attempting your own. Read the datasheet on "Fast" and "Phase Correct" PWM.