It's an interesting idea. I'm just not sure really. I certainly think some of us have our moral codes more deeply ingrained than others. Where that comes from though, I'm not 100% certain. I agree that the vast majority is upbringing though with punishment/ repurcusions if we stray off the rules- like you say.
However, I think Richard Dawkins, in his book 'The Selfish Gene' also said they we inherit altruistic genes. That, as a species we've realised that our chances for survival increase if we help one another to survive. So, perhaps we are in some ways naturally inclined to help one another also.
It's also not just fear of things like God and civil law/ punishment I would say. It's also common sense. If you steal candy from a baby and try to smother it to stop it crying, it's parents will likely beat the shit out of you! (Justifiably.) Commiting attrocities against others, especially violent attrocities caries a great deal of risk. Even animals will sometimes try to avoid fighting because they know that becoming injured will likely mean a death sentence. The person may fight back. They may have friends and family who fight back.
If there were no more laws, vigilantism would surely come in. How many peadophiles would risk acting on their desires if they knew the general population had free reign on what to do to them in retaliation? What would parents really like to do to the people who rape or hurt their children or partners?
It might actually be that there would be less severe crimes if people weren't so restrained in how to treat the criminals. Not that I'm advocating for capital punishment here! I'm just trying to imagine a lawless society.
Surely, people would group together to begin with? Safety in numbers. Also, share of labour. We can't all be specialists at everything. Then- they would look to protect themselves from people within and without their 'tribe'. So- laws basically. I imagine it's actually the majority of people who don't harbor criminal intent so naturally- they will group together.
Where we likely would start seeing problems is if some demographics of the population were viewed as inferior or ripe for servitude/ exploitation. Then, it would be whether those groups could gather enough strength to assert their rights.
Still, I'm not so uncertain that- even if humans were reset to before laws and religions existed, whether we wouldn't still end up with groups of people writing their own laws to keep people in order.
Plus, it's probably the very smartest criminals that work out that the real power and influence is at the top. They'll simply find a way to rule so that they can manipulate laws and people. Commit crimes themselves and, get away with it! (You can guess the multiple presidents I'm refering to...)