Can X be 0 when casting Avacyn's Judgment with madness?
Yes, you can generally choose any value for X, including zero. Exceptions apply, though not in this case.
There are cards where you can't choose X to be zero, or where X is already defined. Those will always be noted on the card itself. Otherwise, you're free to choose any value zero or greater for X.

107.3a If a spell or activated ability has a mana cost, alternative cost, additional cost, and/or activation cost with an {X}, [-X], or X in it, and the value of X isn’t defined by the text of that spell or ability, the controller of that spell or ability chooses and announces the value of X as part of casting the spell or activating the ability

If you cast a spell &quot;without paying its mana cost&quot;, X must be zero.

107.3b If a player is casting a spell that has an {X} in its mana cost, the value of X isn’t defined by the text of that spell, and an effect lets that player cast that spell while paying neither its mana cost nor an alternative cost that includes X, then the only legal choice for X is 0. [..]