Yes, APK is completely legal. It is the native file format that developers use to package an Android app; even Google uses it.
Downloading a modded APK is not a crime, but you're probably putting your phone at risk. Some apps are malwares, others steal money by making your phone pay for premium apps. So just be careful, don't install apps that do not have an icon.