You cannot intersect two arbitrary abstract rings. They have to be subrings of a larger ring in order to do that.
If $A$ is an integral domain (which I will assume from now on), then localizations $\neq 0$ of $A$ can be embedded into the field of fractions $Q(A)$ and their intersection makes sense. (EDIT: This paragraph was refering to the first version of the question)
The inclusion $S \subseteq A \setminus \mathfrak{p}$ gives a map of $A$-algebras $A_{\mathfrak{p} \cup \mathfrak{q}} \to A_{\mathfrak{p}}$. Likewise for $\mathfrak{q}$. Thus, we have $A_{\mathfrak{p}\cup \mathfrak{q}} \subseteq A_{\mathfrak{p}} \cap A_{\mathfrak{q}}$.
I don't know if the other inclusion holds in general. But here are two simple special cases:
- $\mathfrak{p} \subseteq \mathfrak{q}$ or $\mathfrak{q} \subseteq \mathfrak{p}$
- $A$ is factorial and $\mathfrak{p}$ and $\mathfrak{q}$ are principal.
Proof: We may assume $\mathfrak{p},\mathfrak{q} \neq 0$, so that $\mathfrak{p}=(p)$ and $\mathfrak{q}=(q)$ for prime elements $p,q$. If $x \in A_{\mathfrak{p}} \cap A_{\mathfrak{q}}$, choose $a,b,c,d \in A$ with $p \nmid b$, $q \nmid c$ and $x=a/b=c/d$. We may assume that $a,b$ and $c,d$ are coprime. Then $a$ is associated to $c$ and $b$ is associated to $d$. In particular, $q \nmid b$ and we have $x=a/b \in A_{\mathfrak{p} \cup \mathfrak{q}}$.
I suspect that it also holds when the prime ideals are coprime (i.e. $\mathfrak{p}+\mathfrak{q}=A$), but at the moment I cannot prove it.