Yes, it is 100% legal until someone misuses it. There are thousands of apps that are not available on the google play store. If you want to install those apps or games then you have to use Apk files from third-party websites like Apkwars.