No, it is not possible.
Let $A$ and $B$ have coordinates $(x_i,y_i)$ and $(z_i,t_i)$ after $i$ steps respectively. WLOG, initial positions are $(x_0,y_0)=(0,0)$ and $(z_0,t_0)=(p,q)$, where $p$ and $q$ are integers. Let $d=p^2+q^2>0$ - this is invariant. Each step is a replacement of one of the vectors $\vec {a_i}=(x_i,y_i)$, $\vec {b_i}=(z_i,t_i)$ by the sum of the other and some vector $\vec {r_i}=(u_i,v_i)$ such that $u_i^2+v_i^2=d$.
We proceed by induction on $d$ encompassing inner induction on $i$. Consider 3 cases.
1. $d \equiv 1 \pmod 2$. Then $p$ and $q$ are of opposite parity. The same is true for all pairs $(u_i,v_i)$. Hence, the sum $x_i+y_i$ is always even, whereas the sum $z_i+t_i$ is always odd (inner induction on $i$). Therefore, the pebbles will never switch their positions.
2. $d \equiv 2 \pmod 4$. Then $p$ and $q$ are both odd, as like as $u_i$ and $v_i$ for each $i$. Hence, $x_i$ and $y_i$ are always even, whereas $z_i$ and $t_i$ are always odd (inner induction). Therefore, the pebbles will never switch their positions.
3. $d \equiv 0 \pmod 4$. Then $p$ and $q$ are both even, as like as $u_i$ and $v_i$ for each $i$. The same is true for all coordinates of the pebbles (inner induction). Divide all of them by $2$, divide $d$ by $4$ and use the induction assumption for that $d$.