Sure you can avert your eyes, but the DM has to decide if it's reasonable in the situation
D&D 5e is an exceptions based game. This means you cannot use the existence of a rule to infer that it always happens unless the rule says it does. As a corrolorary, you also cannot use the absence of a piece of rules text in situations that rule isn't addressing to infer the opposite of the rule.
In this case, you are trying to do the latter. You are saying because these two monsters allow you to explicitly avert your gaze, does that mean you cannot avert your gaze in any other situation?
The answer to that question is patently no. D&D 5e is written in regular English, not legalese. This means that, unless a phrase is specifically defined in the rules it takes it's normal English meaning. In this case, averting your eyes is not defined, these monster abilities just say you can do it against their specific abilities, so averting your eyes has the normal meaning in English (looking away, closing your eyes or otherwise not looking at a thing). So long has a creature has eyes, they can choose to avert their eyes.
This is just something that creatures with eyes can do. You can choose to walk down the street with your eyes closed during the day, but you'll have a bad timeTM if there are any hostile creatures or obstacles.
So RAW, since sight (and creature's ability to voluntarily obscure their sight by averting their gaze) is not defined in the rules, they take on the normal English meaning and must be assumed to be inherent abilities of creatures with eyes.
Specific example of trying to avoid the Vampire's charm action
If we pre-suppose that a character averting their gaze is reasonable, then we should examine what happens in the situation described, with the Vampire's charm action:
Charm. The vampire targets one humanoid it can see within 30 feet of it. If the target can see the vampire, the target must succeed on a DC 17 Wisdom saving throw against this magic or be charmed by the vampire.
So, we have a few things here:
- The vampire has to be able to see the creature to use the ability
- The creature has to be able to see the vampire for the ability to be used on it
The important thing to note here, is that the creature needs to see the vampire, not look at the vampire's eyes, but just see any part of it. So, in order to avert your gaze to an extent that you can't see the vampire then effectively you are blind to the vampire's location. So, if a character chooses to avert their gaze (on their turn) so as to not fall foul of the vampire's Charm action, they are effectively making themselves blind to the vampire, and should have the blinded condition situation-ally apply while they are fighting or resisting the vampire (and still averting their gaze).
The blinded condition states:
- A blinded character can't see and automatically fails any ability check that requires sight
- Attack rolls against the creature have advantage, and the creature's attack rolls have disadvantage
This has a number of direct implications for the fight against the vampire:
- While they are averting their gaze, for the purposes of fighting the vampire, they have the blinded condition
- While they are blinded in this way the vampire has advantage on attacks against them and they will have disadvantage on attack rolls against them
This means the vampire is much more likely to hit with their unarmed strike (and thus be able to choose to grapple the target without a contest when they hit). This choice is an explicit exception to the normal grappling rules, since the vampire's unarmed strike ability says:
[...] Instead of dealing damage, the vampire can grapple the target (escape DC 18)
Then the vampire will also have advantage on their bite action (and legendary action if the initiative order complies), making them much more likely to crit on the bite (9.75% as opposed to the normal 5%).
The character is also unable to make opportunity attacks on the vampire, as they cannot see the vampire:
[...] You can make an opportunity attack when a creature you can see moves out of your reach. [...]
Finally, the spells the characters want to cast on the vampire that explicitly require the character to see the target cannot be cast (for the same reason).
All in all, this makes the vampire significantly more dangerous of a foe to deal with, due to how much of an increase in damage they will be able to deal. This would significantly increase their offensive CR (they both hit and crit more often than they usually would).
Is the character averting their gaze reasonable?
Not necessarily. It's worth remembering that knowledge in the default settings of D&D is hard to come by. It is most certainly not like our access to information here. Stories, legend, and misinformation on all sorts of topics would be rife, and finding the truth will require specific research or experience. We see this in one of the core assumptions presented in the DMG:
Much of the World is Untamed. [...] People know the area they live in well. They've heard stories of other places from merchants and travelers, but few know what lies beyond the mountains or in the depths of the great forest unless they've been there themselves.
So, unless the character has fought vampires, done specific research into vampires (and found this piece of lore), or seen vampires use this ability before the fight, they may not even know that the vampire can do this. If their character would have no way of knowing, then if the player wants to avert their gaze for this reason, then the DM is perfectly within their rights to say "No, your character wouldn't know to do this".
How would this DM rule a character averting their gaze works?
The player is giving up a lot to avoid this one ability. They have disadvantage on attacks, cannot make opportunity attacks on the vampire, the vampire has advantage on attacks against them, and the character cannot cast sight-requiring spells on the vampire (or characters near the vampire).
As a result, I don't think there are balance problems with allowing this. That being said, there should be limits on the use of it.
Specifically, this isn't something they can turn on and off "for free" during combat. They are actively trying to not see the vampire. So, if they choose to try and see the vampire, it should require some effort to reorient themselves.
Making it use up their free object interaction to switch between the two states would be reasonable. This means they wouldn't be able to, for example, choose to see the vampire for their attacks and then re-avert their gaze each turn. They must, like with the medusa and basilisk, make the choice once on their turn to avert their gaze, but unlike those monsters they can choose to do this more freely.
Additionally, as mentioned, they effectively have the blinded condition for the purpose of interactions with the vampire, along with all the disadvantages that brings. Alternatively, the vampire has, effectively, the invisibility condition with respect to the character (the only difference is in the ability check line).