Ugandan authorities say they have detained dozens of foreigners in a crackdown on illegal migration that was likely linked to human traffickers and cyberscam operations.