Thermoelectric response of Josephson junction: from ballistic to disordered