Your expression for $p(x)$ is
$$ \sum_{k_i\ge 0}\left(\frac{x^{\sum_{i=1}^\infty ik_i}}{\prod_{i=1}^\infty k_i!(i!)^{k_i}}\right)=\sum_{k_i\ge 0}\left(\prod_{i=1}^\infty\frac{x^{i k_i}}{k_i!(i!)^{k_i}}\right). $$
Now, when you expand $\displaystyle \prod_{i=1}^\infty \left(\sum_{k_i=0}^\infty \frac{x^{ik_i}}{k_i!(i!)^{k_i}}\right)$ what you do is, for each $i$, pick a $k_i$, then form the product of all the corresponding $\displaystyle \frac{x^{ik_i}}{k_i!(i!)^{k_i}}$, resulting in $\displaystyle \prod_{i=1}^\infty\frac{x^{i k_i}}{k_i!(i!)^{k_i}}$, and then add all these expressions, but that is precisely what the displayed sum is. (Of course, one picks $k_i=0$ for almost all $i$ in order for the expressions to be meaningful.)
As the comments with Brian indicate, the confusion is perhaps over the way the author is using notation. It is perhaps better to write the first expression as follows: Let ${\mathbb N}^{\mathbb N}_*$ be the set of all functions $f:\mathbb N^+\to\mathbb N$ (all sequences) such that $f(n)=0$ for all but finitely many $n$. The first sum is then
$$ \sum_{f\in\mathbb N^{\mathbb N}_*}\left(\frac{x^{\sum_{i=1}^\infty i f(i)}}{\prod_{i=1}^\infty (f(i))!(i!)^{f(i)}}\right). $$
On the other hand, the product is just
$$ \prod_{i=1}^\infty \left(\sum_{j=0}^\infty \frac{x^{i j}}{j!(i!)^{j}}\right). $$
When you expand, you pick for each $i$ a $j$ (which, naturally, depends on $i$, so we can call it $f(i)$), with the understanding that you pick $j=0$ almost all the time. Etc.
The way the book writes the expressions, essentially the same notation is used to mean two completely different things: First, $k_i\ge0$ means you are looking at an infinite sequences $(k_1,k_2,\dots)$ with almost all $k_i$ being $0$ (this is just an $f\in{\mathbb N}^{\mathbb N}_*$). The second time, in $\sum_{k_i=0}^\infty$, the author now just means $\sum_{n=0}^\infty$, but is using $k_i$ as the index, rather than $n$.
At the bottom of it, what the author is using is a generalized distributive law, a more general case of which would be that in a sufficiently complete Boolean algebra,
$$ \bigwedge_{a\in X}\bigvee\{u_{a,i}\mid i\in I_a\}=\bigvee_{f\in\prod_{a\in X}I_a}\bigwedge\{u_{a,f(a)}\mid a\in X\} $$
for $X$ a non-empty set, $I_a$ a non-empty index set (for each $a\in X$) and arbitrary elements $u_{a,i}$ of the Boolean algebra (for $a\in X, i\in I_a$), though I doubt that this more general presentation would actually clarify things. This family of generalized distributive laws, by the way, is just a reformulation of the axiom of choice.
One final remark is that it is not capriciousness that makes us look only at functions in $\mathbb N^{\mathbb N}_*$ rather than all functions $f:\mathbb N^+\to\mathbb N$: We are actually looking at all functions, but only the ones in ${\mathbb N}^{\mathbb N}_*$ "matter". There are two ways of interpreting the expansions we have. One is purely formal, and then the convention that almost all $k_i$ must be $0$ is essentially a matter of definitions, but this convention is adopted because of the second way: Namely, we can consider the expansions as defining analytic functions (for an appropriate interval where they converge, typically $|x|<1$).
Note that given a sequence $k_1,k_2,\dots$, we have that $\displaystyle \lim_{n\to\infty}\prod_{i=1}^n \frac{x^{i k_i}}{k_i!(i!)^{k_i}}=0$ if $k_i\ne 0$ infinitely often (more precisely, we say that the product diverges to $0$), essentially because $\displaystyle\frac{x^i}{i!}\to0$ as $i\to\infty$. But then the only sequences $f:i\mapsto k_i$ that contribute to the sum are the ones in ${\mathbb N}^{\mathbb N}_*$ anyway.
Everyone struggles to gain intuition with this. The way I came to realize it was to think about the terms in $\delta_{ij}\delta_{jk}$.
$\delta_{ij}$ is zero unless $i=j$, and $\delta_{jk}$ is zero unless $j=k$. So for any $j$, $\delta_{ij}\delta_{jk}$ (no summation) is $1$ if $i$, $j$, and $k$ are equal, and $0$ otherwise.
Now $i$, $j$, and $k$ are all being drawn from the same pool of cartesian indices. So when we do sum over all $j$'s, exactly one of those $j$'s will agree with $i$, and exactly one will agree with $k$. If $j$ agrees with $i$ at the same time it agrees with $k$ (that is, all three indices are equal), we will pick up a $1$. For all the rest, we're summing up zeroes. In other words, the sum is $1$ if $i=k$, and $0$ otherwise. That tensor is $\delta_{ik}$.
Best Answer
The Kronecker symbol $\delta_{ij}$ is used to say $\delta_{ii}=1$ and $\delta_{ij}=0$ if $i \neq j$.
This is independent of any summation. Kronecker symbol can be used in general. That being said, the evaluation of formula $(A)$ is perfectly correct as the only term that is not vanishing is when index $m$ is equal to $n$.