I've never heard of a dwarf hammy getting trapped between the bars and the glass. How big is the gap? Put it like this, a gap of 7mm is mouseproof and dwarf hamster proof and I doubt the gap is bigger than that
The base will also have substrate in, so only the upper bar will be visible mostly. If you were worried though, you could wind/wrap sisal string round them which would fill the gap and be safe to chew.