Which filesystems get overwritten when applying a ROM?
As Izzy has said, this entirely depends on the device and the particular image you are flashing.  Some might flash a new recovery, some not.  Some might flash only the system partition and leave your data alone.  There are even packages that will flash a new bootloader.

If you want to see what a ROM contains, you should open it up and have a look.  Here is a basic explanation of the structure of a kernel flash package.