Spin dynamics and glassy relaxation on fractals and percolation structures