The kinematic Sunyaev-Zel’dovich effect of the large-scale structure (II): the effect of modified gravity