Electronic configuration in [Ni(CN)4]2-
Your thinking is correct. Within a set of degenerate orbitals (i.e. equal in energy), the orbitals will fill one electron at a time, and only after all have one electron will they start to pair up.

The situation with $\ce{[Ni(CN)4]^{2-}}$ is that it has square planar geometry, so the two orbitals that are $e_g$ in an octahedral complex are separated in energy. This diagram from Chemistry LibreTexts shows it nicely:



Because of the separation in energy, the $\mathrm{d}_{xy}$ fills completely (two electrons) before any electrons fill the $\mathrm{}_{x^2-y^2}$.