It's interesting because I don't work in a male dominated field. It's a fairly even mixed of genders at this point, so I don't deal with the types of bullying and harassment you do.
My point in saying this is that it can be taught. They are doing those things because there is a male majority in your work field and they feel entitled to do so. In my field, with an even mix, the men have somehow figured out how to be respectful human beings.
And my guess is the awful men you work with know how not to be that way in social settings where it isn't acceptable. They are fully in control of their behavior. They are choosing to be entitled misogynists. So yes, they can "just stop" if the incentive to do so is present. Whether that is a work environment that stops allowing it, or whether it is punishment to curb the behavior, something will need to change at the top. Because the men themselves are already capable.