My leg hurts when I walk.
This is a perfectly idiomatic and normal usage of English to say that it is uncomfortable for you to walk because your leg hurts, or just to draw attention to the fact that you were injured.
(This sounds a bit strange for me, because I think it makes some actions and kicks somebody when I walk...)
I'm... not sure how you can infer that. I can't say this without sounding facetious, but English doesn't have a mind of its own, and I don't know of any secret cultural standards in the Anglosphere (English-speaking world) that would attach that implication to your sentence. If you didn't say that you kicked someone, then you aren't thought to have gotten in a fight simply because your leg was injured -- that would be a very spontaneous assumption, unless the person making the assumption is a licensed doctor and can tell just by looking that you were probably in a fight.