Consider two morphisms $X\to S$ and $Y\to S$ where all the schemes involved are smooth algebraic varieties over a field $k$. Is it true that $$\dim X\times_S Y=\dim X+\dim Y-\dim S?$$
The case $S=\operatorname{Spec}k$ is well known and may be found basically in every scheme theory book. But I didn't found this more general statement even in EGA.
This is something that perhaps deserves to be true, but is very far from being literally true. For example, take $S$ to be any $k$-scheme and $X=Y$ to be any $k$-points.
Restricting your question to intersections, you might find the Serre intersection formula a better answer close to what you want. Further, see Toen’s ICM address about how derived algebraic geometry can help make better sense of non-transverse intersections like the one in my example.