Is there any regulation to have a gun carried in a box with a security lock like in a home so kids cannot play with it?
It would depend on the state but most do not.
It also kind of defeats the purpose, if you have to get inside a box to get your gun to protect yourself chances are you're dead already as rule #1 on reaching for a gun is you expect to, sadly, have to use it to defend your family and property, so timing is critical. A bullet is a lot faster than 911.
A little history shows us that kids would carry their guns to schools for practice, my how times have changed. Don't shield your kids from guns, that's the best way to guarantee a regrettable accident. Regardless of how you personally feel about them, tech your kids about guns, let them handle them, shoot them, respect and care for them. It's the safest way and not to mention great quality time and a lot of fun. If you're a parent, you know that curiosity can't be stopped. So make them less curious by educating them. Don't let them learn from video games and YouTube gangster videos because they will, in your absence.
I for one am far less worried about my daughter being victimized, she's been around guns all her life, is not a zealot, but is a safe, law abiding, practiced, respectful, gun carrying citizen.