There is a slight misunderstanding here about the product (and box) topologies. It is not true that every open set (in either topology) is a product of open sets. Indeed, consider the open unit ball $\{(x,y)\in\mathbb{R}^2 \mid x^2+y^2< 1\}$ in $\mathbb{R}^2$. This set is open in both topologies (because they coincide for finite products), but it is not of the form $U\times V$ with $U,V\subseteq\mathbb{R}$ open.
The key fact is that these products form a basis for the topology.
If $X=\prod_{i\in I}X_i$ (as sets) and $(X_i)_{i\in I}$ are topological spaces, then the sets of the form
$$
\prod_{i\in I}U_i,
$$
where $U_i\subseteq X_i$ is open for each $i$, form a base for the box topology on $X$.
Recall that if $B$ is a base which generates the topology $(X,\tau)$, then
$$
\tau = \{U\subseteq X \mid U\ \text{is a union of elements of $B$}\}.
$$
This is equivalent to saying that $U\subseteq X$ is open iff for every $x\in U$ there exists $V\in B$ such that $x\in V \subseteq U$. (Try justifying why these two are equivalent.)
On the other hand, we can consider a subbase. If $S$ is a subbase which generates the topology $(X,\tau)$, then
$$
\tau = \{U\subseteq X \mid U\ \text{is a union of finite intersections of elements of $S$}\}.
$$
Note also that if $S$ is a subbase, then we can obtain a base via
$$
B = \{V\subseteq X \mid V\ \text{is a finite intersection of elements of $S$}\}.
$$
This gets to the heart of a matter. We want to prove:
If $X=\prod_{i\in I}X_i$ (as sets) and $(X_i)_{i\in I}$ are topological spaces, then the sets of the form
$$
\prod_{i\in I}U_i,
$$
where $U_i\subseteq X_i$ is open for each $i$ and $U_i=X_i$ for all but finitely many $i$, form a base for the product topology on $X$.
We can do this with the process described above to turn a subbase into a base. We know that the set
$$
S = \{\pi_i^{-1}(U_i) \mid i\in I,\, U_i\subseteq X_i\ \text{is open}\}
$$
is a subbase for the product topology. This means that sets of the form
$$
\pi_{i_1}^{-1}(U_{i_1})\cap \cdots \cap \pi_{i_n}^{-1}(U_{i_n}),
$$
where $i_1,\ldots,i_n\in I$ and $U_{i_k}\subseteq X_{i_k}$ is open for each $k=1,\ldots,n$, forms a base for the topology.
Since the preimage respects unions and intersections, we can assume that $i_1,\ldots,i_n$ are distinct.
Then we have (why?)
$$
\pi_{i_1}^{-1}(U_{i_1})\cap \cdots \cap \pi_{i_n}^{-1}(U_{i_n})
= \prod_{i\in I}U_i,
$$
where
$$
U_i = \begin{cases}
U_{i_k} & \text{if $i=i_k$ for some $k=1,\ldots,n$},\\
X_i & \text{otherwise}.
\end{cases}
$$
No, we do not define the product topology to be $\{U\times V:U\in T_X,V\in T_Y\}$
we define it to the the topology with basis
$\{U\times V:U\in T_X,V\in T_Y\}$.
In all cases, if $U\in T_X$ then $p^{-1}(U)=U\times Y$ which is open in $X\times Y$.
Best Answer
As already said in comments, the basis consists of Cartesian products $U\times V$, where $U$ is open in $X$ and $V$ is open in $Y$.
You can notice that that other possibility does not make sense, since sets from $\mathcal B$ must be subsets of $X\times Y$.
Product of finitely many topological spaces is defined in similar way as for two spaces. But perhaps it is worth to add a word of warning that if you define product of arbitrarily many spaces, then you have to be a bit more careful. (If you simply take products of open sets, you would get box topology, which has different properties from product topology.)