Intestinal worms suck the blood of the animal they are living in. If there are only a few worms the animal is usually fine because they don't lose much blood. However, if there are lots of worms in the animal's digestive tract feeding on blood, the animal/ fish can suffer from low blood levels, low blood pressure and eventually the animal or fish dies from lack of blood.
The worms can spread with contaminated water, fish or through food.
The round worms in fish are usually 3-10mm long and quite thin.
They might have spread to the axolotl with the filter. If the fish didn't have many worms when you moved the filter media across, it might be ok. But if the fish had lots of worms and had been in the tank with the filter media for a while, there might have been a few that got moved across with the filter media.
Do a google search for Levamisole or Flubendazole. You can sometimes get it form Amazon or Ebay, and a lot of pet shops sell it but not always under the name Flubendazole. Just look for fish dewormers and see if the active ingredient is Levamisole or Flubendazole.