If by $B$ you mean the Borel $\sigma$-algebra on $\mathbb {R}$ then the answer is yes. In the more general case of the Borel $\sigma$-algebra on an arbitrary topological spaces then the answer is that it depends on further topological properties of $X$.
A more general situation is discussed in https://mathoverflow.net/questions/39882/.
The analysis of the situation is not trivial and depends on a careful construction of the Borel $\sigma$-algebra by $\sigma \delta$ sets. Since $\sigma$-algebras are constructed to only be closed under countable operations, while topologies need to be closed under arbitrary unions, product $\sigma$-algebras tend to be smaller than product topologies, unless the topologies in question are 'small' in the sense of having a countable basis (or other such conditions).