If $p_i:X\rightarrow Y_i$($i=1,2$) are immersions, is $X\rightarrow Y_1 \times Y_2$ immersion?
Yes. Your morphism factors as $X \to X \times_S X \to Y_1 \times_S Y_2$. Now the claim follows from the following facts:
- The diagonal morphism $X \to X \times_S X$ is an immersion (for any $X/S$)
- Immersions are stable under fiber products.
- Immersions are stable under composition.