「~~に当たる」 can surely mean both of what you said. I have never even thought of this until today but I could sort of understand your confusion, which I feel arises from "translation", which is what bilingual dictionaries are based on.
Think of it this way for a moment. For a thing/person to hit another, both are involved as they must touch each other. A bullet can hit a person and a person can "hit" a bullet, but because it sounds incorrect and/or unnatural to say in English "I hit the bullet." in the active voice, they say "I was hit by a bullet." in the passive voice. This is the problem (and the limitations) with bilingual dictionaries. For the sake of giving natural-sounding definitions and sample phrases, bilingual dictionaries often tend to go rather freely, in their explanations, between transitive and intransitive verbs and active and passive voices.
And yes, you could say ~が弾丸に当たった to mean that something hit a bullet. You can also say ~~を弾丸に当てた.