The functions are dependent on the notes of the chords which define the chord types. More accurately the chord functions are dependent on the scale degrees of the key. (note that the function is heard relative to the key not relative to the chord of the moment)
For example the tonic function is defined by the 1 and 3 degrees of the key. In C major this is C & E. Those chords that have C & E as part of their basic triad are tonic in function. (Imaj (C major) and VImin (A minor) chords)
The Subdominant function is (in part) defined by the 4 & 6 degrees of the key. In C major this is F & A. Those chords that have F & A as part of their basic triad are subdominant in function. (IVmaj (F major) and IImin (D minor) chords)
The dominant function is (in part) defined by the leading tone of the key. But the leading tone doesn't exist in most of the modes so the V chord will have a a different flavor in modes other than Ionian.
Check it out. Look as the parent keys scale degrees to see how and why these common chord progressions are so powerful.