Alakazam may not have a tail, but its pre-evos do
Look at Kadabra's tail here
![](/pokebase/qa-plugin/https-img-proxy/image.php?key=f9cf305aaab5cf53&url=http%3A%2F%2Fpldh.net%2Fmedia%2Fpokemon%2Fgen5%2Fback%2F064.png)
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