Is it possible that the product of two non-affine schemes becomes affine?

A kind of trivial example which is similar to your intersection example for general fiber products: if $K$ and $L$ are fields of different characteristic and $X$ is a non-affine scheme over $K$ and $Y$ is a non-affine scheme over $L$, then $X\times_\mathbb{Z} Y=\emptyset$ is affine.

Over a field $k$, however, this cannot happen. More generally, if $X$ and $Y$ are schemes over $k$ such that $Y$ is nonempty and $X\times Y$ is affine, then $X$ is affine. To prove this, choose a point $y\in Y$ and consider $X\times \operatorname{Spec} k(y)$. Since the inclusion $\operatorname{Spec} k(y)\to Y$ is an affine morphism, so is $X\times \operatorname{Spec} k(y)\to X\times Y$, and so $X\times \operatorname{Spec} k(y)$ is an affine scheme. Thus the projection $X\times \operatorname{Spec}k(y)\to\operatorname{Spec} k(y)$ is an affine morphism. Since affineness of morphisms is local on the base in the fpqc topology (see here, for instance), it follows that $X\to\operatorname{Spec} k$ is affine, and hence $X$ is an affine scheme. (The choice of a point $y$ here is just because in general, I don't think you can conclude that the projection $X\times Y\to Y$ is an affine morphism from the fact that $X\times Y$ is affine without some hypothesis on $Y$.)