Below we can see that 7b9 chords can be substituted with diminished 7th because the diminished 7th chord is constructed with a subset of the notes in 7b9. If we leave off the root note in a 7b9 chord we are left with just diminished 7th.
We can substitute a diminished 7th chord starting from the 3rd, 5th, b7th, or b9th root note of a 7b9 chord.
Let's examine some practical examples of this substitution with a few 2- 5 1 sequences in the key of D Major. We will be substituting A7 with A7b9, and adding one more substitution by replacing 7b9 with its available diminished 7th substitutions described above.
Here is another 2- 5 1 example in D Major, this time with two diminished 7th inversions substituted for the 5 chord.