Partial Result (when $k$ divides $n$). The maximum value in this case is $\left(\dfrac{a}{k}\right)^k$. However, I think the answer is still $\left(\dfrac{a}{k}\right)^k$ even when $k$ does not divide $n$.
Here we assume that $x_1,x_2,\ldots,x_n\geq 0$ (if the variables are strictly positive, then there are cases where the maximum does not exist). Suppose that $k$ is a divisor of $n$. Write $n=mk$ for some positive integer $m$. Let
$$S:=\sum_{i=1}^n\,x_ix_{i+1}x_{i+2}\cdots x_{i+k-1}\,,$$
where the indices are considered modulo $n$. Observe that
$$S\leq \prod_{r=1}^{k}\,\left(x_r+x_{r+k}+x_{r+2k}+\ldots+x_{r+(m-1)k}\right)\,.$$
By the AM-GM Inequality,
$$S\leq \left(\frac{1}{k}\,\sum_{r=1}^k\,(x_r+x_{r+k}+x_{r+2k}+\ldots+x_{r+(m-1)k})\right)^k\,.$$
Consequently,
$$S\leq \left(\frac{1}{k}\,\sum_{i=1}^n\,x_i\right)^k=\left(\frac{a}{k}\right)^k\,.$$
The maximum value is attained, for example, when $$x_1=x_2=\ldots=x_k=\dfrac{a}{k}\,,$$ and $$x_{k+1}=x_{k+2}=\ldots=x_n=0\,.$$
Another Partial Result (when $k=2$ and $n\geq 5$ is an odd integer). The maximum value is also $\left(\dfrac{a}{k}\right)^k=\left(\dfrac{a}{2}\right)^2$.
To show this, suppose without loss of generality that $x_1$ is the smallest value among $x_1,x_2,\ldots,x_n$. Observe that
$$S\leq S_1S_2\,,$$
where
$$S:=x_1x_2+x_2x_3+\ldots+x_{n-1}x_n+x_nx_1\,,$$
$$S_1:=x_1+x_3+x_5+\ldots+x_{n}\,,$$
and
$$S_2:=x_2+x_4+x_6+\ldots+x_{n-1}\,.$$
This is because all terms $x_1x_2,x_2x_3,\ldots,x_{n-1}x_n$ in $S$ appear in $S_1S_2$, and the term $x_nx_1$ in $S$ is less than or equal to the term $x_nx_2$ in $S_1S_2$. Therefore,
$$S\leq \left(\frac{S_1+S_2}{2}\right)^2=\left(\frac{a}{2}\right)^2\,.$$
The maximum value is attained, for example, when $$x_1=x_2=\dfrac{a}{2}\text{ and }x_3=x_4=\ldots=x_n=0\,.$$