The diminished scale can be played over diminished chords, i.e. play a C diminished scale over a C diminished chord. The diminished scale can also be played over b9, #9, or b5 dominant chords by beginning the scale a half step above the root of the chord. For example, you can play the C diminished scale over B7b9, B7#9, and B7b5 chords.
Here are 2 shapes of the C diminished scale starting on the 3rd and 8th frets:
The diminished scale is symmetrical whereby there are only 3 different scales possible. Starting the scale a minor 3rd above or below the initial root results in the same notes. Basically, the scale repeats every minor 3rd movement. The C, Eb, Gb, and A diminished scales all contain the same notes.
As I mentioned, the diminished scale may also be used over b9, #9, or b5 dominant chords by beginning the scale a half step above the root of the chord. For example you can play the C diminished scale over B7b9, B7#9, and B7b5 chords. The simple theory behind this is that the the diminished scale contains those 3 altered tones (the b9, the #9, and the b5).