I'm pretty sure it's not legal, but quite a few people still do as they're the necessary tools of certain lines of extralegal business
Brazil's a place where people still shoot first and ask questions later... or don't stick around for the questions, especially if it's a cop or a BOPE. Those guys are literally real life Judge Dredd.
Military service is mandatory for most healthy college boys so they know how to use it and know they need it to survive legal or not in some neighborhoods. When there don't make any funny moves, you never know who is packing heat.