First, there are no studies that I am aware of that show vitex prevents or treats gyno caused by anabolic steroids, so any remarks in that regard are speculation. That said, vitex has been shown to lower prolactin levels in mice and women. Prolactin secretion is inhibited by dopamine, and vitex seems to show dopaminergic activity.
Progesterone is one of many compounds that seems to raise prolactin levels. Some anabolic steroids, like deca and fina, bind relatively strongly to the progesterone receptor. It is possible that these agents could elevate prolactin levels, but studies (1) have shown otherwise.
(1) Clin Nephrol 1989 Oct;32(4):198-201 Anabolic steroid-associated hypogonadism in male hemodialysis patients.
Maeda Y, Nakanishi T, Ozawa K, Kijima Y, Nakayama I, Shoji T, Sasaoka T.