In a way: diatonic chords contain only notes from that scale. So in C you get these basic chords:
C E G = C
D F A = Dm
E G B = Em
F A C= F
G B D = G
A C E =Am
B D F= B-diminished
So if you only use these chords you'll be perfectly safe. There are further 'rules' (read: things often done in the past!) that might help on getting a progression together. The basics for a four-chord progression.
1) Start on the I (C-major here)
2) Go anywhere you want
3) Go to one of the sub/pre-dominants ii or IV (here Dm or F)
4) Go to one of the dominants (V or viiDim, G or Bdim here)
This will give you 95% of the progressions found in popsongs. Some examples:
C-Am-F-G
C-Em-Dm-Bdim
for a chord progression in D only be able to use chords whose root notes were from the D major scale?
Not just the root, all notes. So if you are in C D-minor (D F A) is diatonic whereas D-major (D F# A) is not because there is no F# in the C-major scale.
IMPORTANT!!!
Don't see this as a set of rules. Music that is 100% diatonic tends to be incredibly dull, predictable and boring. Use this as a foundation, the core of your song. Then 'spice' it up using notes outside of your key. For example, when playing an F-chord followed by a G-chord you could play the F# in between as a bassline. F->F#->G, just make sure you don't emphasize those notes too much: too much salt will ruin a good dish, no salt at all will result in a tasteless meal.