Yeah, in fact it is cheer luck that they haven't actually forced him to join one of the gangs, which is another form of survival, since even with a gun, he would still need social protection from everyone, including the gangs offering the "protection"
He's lucky that Gabu is reasonably influential in the group, as that may offer him
some protection.
As noted at the end of chapter 2, Joao doesn't have a lot of options that pay as well as joining the I.M. Putting aside the survival odds, just from the financial standpoint it can be advantageous.
It's also pretty easy to find yourself doing something small for a friend in the gang, then something a little bigger, then something serious and before you know it you're involved in shit you didn't want to be in. We see this already where Joao's acting as lookout.
That and sometimes they don't have a choice. Sometimes it can be a lot like being press-ganged. Gabu's influence didn't save that kid at the start of chapter 4.