What's the scale for these chord progressions?

sorry if i use terms incorrectly. never paid intention in school when this was teached and have a very mechanical understanding of how scales and chords work.

what’s the pattern behind these progressions:

  1. C B Em
  2. Am Fm C

is it simply that in the first case we are in E minor and the dominant Bm is replaced with it’s major counterpart. and in the second example we are in C major and the subdominant F is replaced with it’s minor counterpart Fm?

so, i would use these scales to write my melodies or what notes would i use over the B / the Fm chord?