I am having difficulty to understand the first line of the proof of theorem 3.22 below. (taken from a linear analysis book)

Why need to be different index, i.e. $m,n$ when multiplying the two sums? This is very basic, but I really need help for explanations.
That's because it is notationally bad and depending on how you read it, it may even give different results. For example, consider simple vectors in $\mathbb{R}^{3}$ given by $v=a_{1}e_{1}+a_{2}e_{2}+a_{3}e_{3}=\sum_{n=1}^{3}a_{n}e_{n}$. Then if we use same index, \begin{equation} \begin{aligned} ||v||^{2}&=\left(\sum_{n=1}^{3}a_{n}e_{n},\sum_{n=1}^{3}a_{n}e_{n}\right)\\ &=\sum_{n=1}^{3}\sum_{n=1}^{3}a_{n}\bar{a}_{n}(e_{n},e_{n})\\ &=\sum_{n=1}^{3}(a_{1}\bar{a}_{1}(e_{1},e_{1})+a_{2}\bar{a}_{2}(e_{2},e_{2})+a_{3}\bar{a}_{3}(e_{3},e_{3})) \end{aligned} \end{equation} which clearly does not make sense because we have extra summation. Even if you remove the extra summation, we get \begin{equation} \begin{aligned} ||v||^{2}&=\left(\sum_{n=1}^{3}a_{n}e_{n},\sum_{n=1}^{3}a_{n}e_{n}\right)\\ &=\sum_{n=1}^{3}\sum_{n=1}^{3}a_{n}\bar{a}_{n}(e_{n},e_{n})\\ &=a_{1}\bar{a}_{1}(e_{1},e_{1})+a_{2}\bar{a}_{2}(e_{2},e_{2})+a_{3}\bar{a}_{3}(e_{3},e_{3}) \end{aligned} \end{equation} which is notationally "looks" fine but wrong, because inner product should hold for any basis, not just orthonormal basis. The different indices allow us to use the power of good notations correctly.