The following is not mathematical rigorous. Most importantly, I want to stress that it is hard to make precise statements without knowing the conventions and definitions of the source (which doesn't put them after all). So the following might not be coherent with the computations done in the source and I indeed obtain a different result for the screened interaction, see also the brief discussion at the end of this answer.
We put our system in a box $\Lambda$ with volume $|\Lambda|:=\mathrm{Vol}(\Lambda)$ and employ periodic boundary conditions. If $f$ denotes a function of two variables, then we can construct a new $\Lambda$-periodic (in each argument) function by
$$f_\Lambda(x,x^\prime):=\sum\limits_{kk^\prime}e^{ikx}\, e^{ik^\prime x^\prime}\, \hat{f}_\Lambda(k,k^\prime) \quad , \tag{1} $$
where the Fourier coefficients for a function of two variables are defined as
$$ \hat f_{\Lambda}(k,k^\prime) := \frac{1}{|\Lambda|^2}\, \int\limits_{\Lambda\times \Lambda}\mathrm dx\,\mathrm dx^\prime e^{-ikx}\, e^{-ik^\prime x^\prime} \,f(x,x^\prime) \tag{2} \quad .$$
For a function of a single variables, we make obvious changes in $(1)$ and the corresponding coefficients are defined with one integration and one inverse volume factor less. The summation in $(1)$ runs over all wave vectors respecting the periodicity conditions.
To proceed, given a $\Lambda$-periodic function $f_\Lambda:\mathbb R^3\longrightarrow \mathbb R$, we can define another function $h_\Lambda:\mathbb R^3\times \mathbb R^3 \longrightarrow \mathbb R$ by $h_\Lambda(x,y) :=f_\Lambda(x-y)$. It holds that:
$$\hat h_\Lambda(k,k^\prime) = \delta_{k+k^\prime,0}\, \hat f_\Lambda(k) \tag{3} \quad . $$
We can apply this to the Fourier expansion of the periodic Coulomb potential $V=1/|\cdot|$, yielding (by a mild abuse of notation)
$$\frac{1}{|x-x^\prime|} = \sum\limits_{k} e^{ik(x-x^\prime)}\, \hat V_\Lambda(k) \quad . \tag{4}$$
The authors now, I assume, replaced the integration in equation $(2)$ with the integration over the whole space; put differently, they've replaced the coefficient in the Fourier series with the Fourier transform (modulo some volume factor(s)). This is for example discussed/used/explained in Ref. 1-3. Doing so readily yields
$$\frac{1}{|x-x^\prime|} = \frac{1}{|\Lambda|}\sum\limits_{k}e^{ik(x-x^\prime)}\, \frac{4\pi}{|k|^2} \quad ,\tag{5}$$
which coincides with equation $(2)$ of the question if we write $k=q+G$ for $q$ form the first Brillouin zone and $G$ a reciprocal lattice vector. We've defined the (d-dimensional) Fourier transform of a function of two variables as follows:
$$ \hat f(k)=\mathcal F(f)(k,k^\prime) := \int\mathrm{d}x\,\mathrm dx^\prime \, e^{-ikx}\,e^{-ik^\prime x^\prime}f(x,x^\prime) \quad .\tag{6}$$
For a function of a single variable we make appropriate changes.
Let met stress once more that equation $(4)$ is not the Coulomb potential; both functions agree only if $x-x^\prime \in \Lambda$. Moreover, equation $(5)$ is not the Fourier series of the corresponding periodic potential. In the thermodynamic limit, however, these replacements are justified, cf. Ref 1-3.
The second example, the screened interaction denoted here as $W$, is a bit more complicated and we have to make further assumptions. First, we assume that $\epsilon^{-1}(x,x^\prime) = \epsilon^{-1} (x+L,x^\prime+L)$, where $L$ is any direct lattice vector, cf. Ref 4. We conclude from this (exercise) that the Fourier transform $\hat \epsilon^{-1}(k,k^\prime)$ vanishes if $k+k^\prime\neq G^\prime$ for some reciprocal lattice vector $G^\prime$. Second, I think that the source defined the Fourier transform differently compared to our equation $(6)$, namely as
$$\tilde\epsilon^{-1}(k,k^\prime):=\int\mathrm dx\mathrm \, dx^\prime\, e^{-ikx}\, e^{+ik^\prime x^\prime } \epsilon^{-1}(x,x^\prime) = \hat\epsilon^{-1}(k,-k^\prime) ~ ,\tag{6.5} $$
see again e.g. Ref. 4.
With these things in mind, we can proceed. The strategy is the very same as above and we again replace the coefficient in the Fourier series by the Fourier transform (up to the volume factors). To this end, we compute the Fourier transform of the considered function $W$ by making use of the shift-property of the Fourier transform:
\begin{align}{\small \mathcal F(W)(k,k^\prime) }&= \small{\int \mathrm dx\,e^{-ikx}\,\int\mathrm dx^{\prime\prime}\,\epsilon^{-1}(x,x^{\prime\prime}) \underbrace{\int\mathrm dx^\prime \,e^{-ik^\prime x^\prime}\, \frac{1}{|x^\prime-x^{\prime \prime}|}}_{=\mathcal F(1/|\cdot|)(k^\prime) \, e^{-ik^\prime x^{\prime\prime}}} \tag{7}}\\
&= \frac{4\pi}{|k^\prime|^2}\,\int \mathrm dx\,e^{-ikx}\,\int\mathrm dx^{\prime\prime}\,\epsilon^{-1}(x,x^{\prime\prime})\, e^{-ik^\prime x^{\prime\prime}} \tag{8} \\
&= \frac{4\pi}{|k^\prime|^2}\,\hat\epsilon^{-1}(k,k^\prime) \quad . \tag{9}
\end{align}
Now by plugging this in the respective Fourier series of $W_\Lambda$, and making use of our aforementioned considerations, we obtain (with a mild abuse of notation)
$${\small W(x,x^\prime) = \frac{1}{|\Lambda|^2}\,\sum\limits_{k G^\prime} e^{ikx}\, e^{-i(k-G^\prime)x^\prime} \,\frac{4\pi}{|k^\prime|^2}\, \hat\epsilon^{-1}(k,-(k-G^\prime)) \tag{10} \quad.}$$
Further, by again writing $k=q+G$ this becomes
$$\!\!\!\!\!\!\!\!{\scriptsize W(x,x^\prime) = \frac{1}{|\Lambda|^2}\,\sum\limits_{qGG^\prime}e^{i(q+G)x} \,e^{-i(q+G-G^\prime)x^\prime}\, \frac{4\pi}{|q+G-G^\prime|^2}\,\hat\epsilon^{-1}(q+G,-(q+G-G^\prime)) \tag{11} ~ . }$$
I think the very last thing we can do here is to shift the index of the $G^\prime$ summation (note that we sum over all reciprocal lattice vectors), i.e. for each fixed $G$, we shift the summation as $G^\prime\rightarrow -G^\prime +G$, and make use of the different convention regarding the Fourier transform we've employed, which yields
$${\scriptsize W(x,x^\prime) = \frac{1}{|\Lambda|^2}\,\sum\limits_{qGG^\prime}e^{i(q+G)x} \,e^{-i(q+G^\prime)x^\prime}\, \frac{4\pi}{|q+G^\prime|^2}\,\underbrace{\tilde\epsilon^{-1}(q+G,q+G^\prime)}_{=:\tilde \epsilon^{-1}_{GG^\prime}(q)}\tag{12} ~ .}$$
The definition of $\tilde\epsilon^{-1}_{GG^\prime}(q)$ in $(12)$ is used in the paper which is cited in the reference given in the question (although even there I could not find the very definition).
As mentioned at the very beginning, this is nearly the result posed in the question, but with a different index in the Fourier transform of the Coulomb potential and an additional inverse volume factor. Yet, for me this makes sense, as the $x^\prime$ variable in $W$ is plugged in the Coulomb interaction, and the corresponding "conjugated" variable to $x^\prime$ here is $k^\prime$. The additional volume factor for me makes sense, too, by purely dimensional grounds. But it could also be that the reference puts the volume factors also partially to the Fourier transform, which would then solve this pre-factor issue.
Finally, another argument for why these things seem correct (or at least, not "totally wrong") is that we can recover $W$ from equation $(12)$, or equivalently $(10)$, in the thermodynamic limit which however seems not possible if we had only one inverse volume factor and the different index.
As a last point, I don't quite understand why the authors refer to $|\Lambda|$ as the unit cell volume.
I admit that all of this looks very "constructed"; so take everything with a grain of salt. Perhaps someone can spot a mistake - I'd be very grateful for any hint.
References:
Many-Body Problems and Quantum Field Theory: An Introduction. Martin and Rothen. Section 3.2 page 111 and section 4 pages 135-137.
Nonequilibrium many-body theory of quantum systems. Stefanucci and Leuuwen. Appendix E, page 529.
Response Theory of the Electron-Phonon Coupling. Starke and Schober. Sections 2.2.1 and A.5. arxiv
Quantum Theory of the Solid State: An Introduction. Kantorovich. Section 5.4.5.2, equations $(5.201)$ and $(5.209)$.
For a discussion on the imposed periodicity, this physics stackexchange question might be of interest.
~
instead ofquad
before,
$\endgroup$