it's probably more a combination of genetics and the way your dick sits in your pants from day to day
for example if you've worn briefs for underwear all your life, your dick might be more likely to curve upward or downward based on how you like to tuck it in your underwear, just because its always put in that position (this effect is probably most prominent during puberty when your penis is growing)
otherwise, if at all, there's probably only a slight effect on penis curvature through masturbation