By definition, all transition metal ions have d orbitals. These are normally degenerate, lying at the same energy level as there is nothing to break the symmetry.
However, in the presence of ligands, the symmetry is broken and the orbitals split into different energy levels. This is due to differing alignment with the ligands resulting in a different electric repulsion from then lone pairs on the ligands.
For example, in an octohedral complex like [Cu(H2O)6]2+, the dx2-y2 and dz2 orbitals point directly at the ligands whereas the dxy, dxz and dyz orbitals all lie between the ligands. This means that the former experience greater electronic repulsion and are therefore raised in energy compared to the latter.
The split in energy levels means that electrons can be excited from the lower to the higher energy level by absorbing a photon. The energy of the this photon relates to its frequency by E=hf meaning that complexes absorb light of one partiular colour. They therefore transmit the complimentary colour and this happens to be in the visible light range so they appear coloured.