You can’t get loot boxes for completing challenges in the vanilla version of the game. You can download Minecraft mods that do that. There are plenty of Loot-box map modification files on Planet Minecraft.