Here's your equation with an additional couple of parenthesis that emphasizes the order of the operations (note that you had a small typo in your original equation).
vπ(s)=∑aπ(a∣s)(∑s′,rp(s′,r∣s,a)[r+γvπ(s′)])
Now, let me answer your other questions.
Is the second sum using the index $a$ from the first sum?
Yes.
Or is it independent, and can I move out the $[r+ \gamma v_\pi(s')]$ term out of the sum?
No, and you cannot move this term out of the sum because the second sum is a sum over $r$ and $s'$ and $r+ \gamma v_\pi(s')$ depends on those terms.
Note that $v_{\pi}(s)$ is defined as an expectation and that $\pi(a \mid s)$ (the policy) and $p(s',r \mid s,a)$ (the model) are probability distributions.