It really depends on the structure...
So now, you already know it is a bad idea to fire a (huge) gun in a confined space...
To conceal a ship you don't need to build a big heavy thing. A wooden of steel frame can be made. Covered with wooden planks, corrugated steel or even burlap can be used to hide it from view. Like the Japanese did with the building of the Yamato.
It might even allow you to move the guns out to the side where the enemy is. When the guns fire you don't want to be near. I don't have good numbers, but some video will give you an idea. First start with small Leopard 2 gun firing, only 120mm. You don't want to be in front of that. Or anywhere near without ear protection. Now here is a nice video about the workings of those lovely big guns: Firing Operations of Heavy Battleship 16"/406mm Guns, 7:25 for the shooting part.
So with a light structure, everyone near, let keep it to Danger Close distances. (I know this is for explosions, but firing a 16" guns is a big explosion, just very directed.) So, that makes 2000 meters for every one to have big hearing problems. If not outright deaf. And every thing that is not bolted down will move. The closer to the gun, the more. One big shotgun blast of dirt and debris, if not for the bullet itself. Yes, people will be blown over and break things. And your ship will be covert with that is left of the building.
So you want big, hard and somewhat secure. Sure, we have the thing for you! Let build an oversized Submarine pen. This thing is going to be huge, battle ships are no where near as small as submarines. And I don't think you can move the guns too much to the sides, it will be cramped in there.
But if a gun goes off here it will be much worse, as the whole structure will work as a gun barrel itself and the sheer pressure of the blast will not dissipate as much as in the open. It's probably not good for the structural integrity of the building as well.
In the end we are just talking about an explosion, either in the open or in an enclosed space.
In both cases you will need to find a way to power your ship to be able to aim and fire the guns. And unless you have updated and automated lots of it, you will need quite a crew on hand to do so.
As with aircraft and tanks, there will be few if any locks and keys to stop someone gaining access to your toy. Most often you will find guards with weapons and backup.