Alakazam may not have a tail, but its pre-evos do
Look at Kadabra's tail here

You can see that it obviously has a tail, so that explains that it can use Iron Tail in battle. Alakazam can learn it because its pre-evos can.
PS: Don't run Iron Tail Alakazam in battle, it has terrible attack :P