The repeated indices denote a sum. Thus ##\vec u = u^i \vec e_i##. Since the ##i## here is a summation index, it does not matter what you call it. You can call it ##i##, ##j##, ##k##, or ##\xi## to your heart's delight without changing the meaning. What you cannot do is to take two sums where you have used the same index and treat their multiplication as a single sum. Instead, you must rename one of the summation indices and keep both sums. For example, consider your case, writing out the sums
$$
\vec u \cdot \vec u = (u^1 \vec e_1 + u^2 \vec e_2 + u^3\vec e_3) \cdot (u^1 \vec e_1 + u^2 \vec e_2 + u^3\vec e_3) = (u^i \vec e_i) \cdot (u^j \vec e_j).
$$
Consider what this would have been if you had used the same index and still summed over it
$$
u^1 \vec e_1 \cdot u^1 \vec e_1 + u^2 \vec e_2 \cdot u^2 \vec e_2 + u^2 \vec e_2 \cdot u^2 \vec e_2.
$$
You might say that you can tell the sums apart anyway but my experience after teaching relativity for several years is that you really cannot and that you really need to separate the sums using different indices. One of the more common errors students do is to use the same summation index for different sums and then they forget which belonged where and happily (until they get their test score back) sum the wrong terms together.