Its totally fine. For bars with impacted dirt in the ends I have used a blunt screwdriver to dig as far in as possible, then put water in and leave it to soak though the dirt. Adding dishwash liquid helps too.
You should be able to poke a wire or string all the way through the bars.
I'll use a hot air blower to dry the whole bars outside and inside through both ends. Also I hang it up to save burning the fingers.
Once its cooled down again, I sand any imperfections, and then use an aerosol spray can of anti-rust/primer to blast down both ends of the bars in turn. Its not going to coat all the inside, but should help longterm, specially right at the ends.
Then I prime the outside, wait, sand, top coat, wait, (sometimes I do a clearcoat) and then reassemble carefully. Fit new grips once the brakes and stuff are on.