In Single Player, it happens most often (randomly) on Easy Difficulty. When I was playing on Hard, it never happened to me. The "leaning" ability in Single Player doesn't let you reliably avoid such hits, and enemy dodging is automatic (depending on the enemy and weapon used against them, plus the difficulty level). To modify the NPC's you'd have to edit their files (not sure which ones, it's been too long for me, to be honest).
In Multiplayer you can't do it (unless you're using some server or client mod that has "dodging" as a feature).