How is a classical bipartite state written in quantum notation?

As in the title, is a classical bipartite state on $$AA'$$ given by

$$\sum_{ij} p_{ij} \vert i\rangle\langle i\vert_A \otimes \vert j\rangle\langle j\vert_{A'}$$

with $$\sum_{ij}p_{ij} = 1$$.

In particular, is the second index $$j$$ even necessary or can this be replaced by $$\sum_{i} p_{i} \vert i\rangle\langle i\vert_A \otimes \vert i\rangle\langle i\vert_{A'}$$

with $$\sum_i p_i = 1$$ instead? If yes, how does one show this and if not, what exactly does the second state represent (some kind of special classical-classical state)?

A classical state $$\rho_X = \sum_x p_x |x\rangle \langle x |$$ is meant to represent a random variable $$X$$ which takes a value $$x$$ with probability $$p_x$$.
If we have two random variables $$X$$ and $$Y$$ with a joint distribution $$p_{xy}$$ then we can represent it by the bipartite classical state $$\rho_{XY} = \sum_{xy} p_{xy} |x\rangle \langle x | \otimes |y\rangle \langle y |.$$ Note that this is consistent with the marginal states representing the marginal random variables!
The second state you mention in the question would represented the joint random variable $$XY$$ where $$p_{xy} = 0$$ whenever $$x \neq y$$.