It's like shooting a bullet straight up in the middle of the crowd, if it hits someone, it is still your fault for risking that someone would get hurt, because it was you who pulled the trigger.
It's nothing like that. Not only is it a reasonable expectation for someone to not fire a gun in the air, but the magnitude of the impact is on a completely different plane.
It's like stepping on someone's toes by accident. Yeah, you probably should have been more careful, but it's not unreasonable that you weren't looking at your feet to make sure that you didn't step on anyone. In the same vein, once it happens you should probably apologize, but in the end it's that person that has to deal with the pain.
Also applicable to what I said earlier: if you knew that person's foot was directly under your next stride (if you knew the joke would offend them) it's unacceptable for you to step on their toes (make the joke). But, if you had no idea, it's not really your fault that you didn't make sure that their feet weren't where you were walking.