Can I clean out a set of old handlebars with water? I've bought these bars second hand and would like to clean them out before I use them. Right now they're full of dust, dirt, spiders, etc.

Will it do any damage to run water through them? I'll, of course, let them drain and dry before putting them to use.
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.