Effect of substrate on optical bound states in the continuum in 1D photonic structures