I think of it like this. A modal scale will have seven notes. Let's assign a number to each note in the scale, so if your scale is C major (C D E F G A B), then C becomes 1, D becomes 2, and so on.
Each of those notes will have a triad (three-note chord) associated with it. That triad will be that note (the chord's root), that note plus 2 (the chord's third), and that note plus 4 (the chord's fifth). (Remember, these numbers refer to the position of the note in the scale, not keys on a keyboard.) You might prefer to think of it as just skipping every other note in the scale. So your triads are going to be 1-3-5, 2-4-6, 3-5-7, 4-6-8, 5-7-9, 6-8-10, and 7-9-11.
So for the C major scale, C D E F G A B, the first chord (1-3-5) is C-E-G. That happens to be a major chord. The second chord (2-4-6) is D-F-A. That's a minor chord. The last chord in the scale (7-9-11) is B-D-F. That's a diminished chord. Put them all together and you get C Dm Em F G A Bdim, or I ii iii IV V vi viio.
Now if we do this exercise again with C minor, our scale is C D E♭ F G A♭ B♭. This time the chord for C is C E♭ G since the third note in the scale is a flat, so it's a minor chord. The chord for D is D F A♭, a diminished chord, and so on.
That said, there are songs that use chords that are not native to their scales. I'm currently writing a funk song that has a i - IV - i - IV - V - IV - i - i progression. The song uses the Dorian scale, as so much funk does, but V doesn't fit into Dorian. It "should" be v, but the song sounds much better with V. Why? I dunno. Funk is funky, man.