Polarization modes of gravitational waves in general modified gravity: General metric theory and general scalar-tensor theory