This is not a chord of B major, nor of B minor, but a chord 'on B' in the key of C major; B being the 7th note of C major, and D and F both being in that key. (Yes, it could be A minor alternatively.)
This chord is usually referred to as VII, because it's based on the 7th note of the key. VII chords are always diminished triads in any key.
In 'Twinkle Twinkle Little Star', you might use a VII chord on 'How I' before returning to the tonic on 'wondered'.
B major and B minor are not 'in the key of C', because there are no sharps in C major. You would find a B major chord only in a key with B, D# and F# e.g. V of E major or I of the key of B major. B minor chord would be in any key with B, Dn and F#, e.g. III of G major, II of A major, etc.