Stochastic dynamics in quenched-in disorder and hysteresis