Dimension-free error estimate for diffusion model and optimal scheduling