If you watch major baseball leagues, you will see most of the professional players wear sunglasses. It is pretty impossible for a human being to play under the hot sun for a long time without protecting their eyes. So, the answer is NO; there is no prohibition from wearing sunglasses on the baseball field. But in certain situations, match officials can tell a player to remove their sunglasses. Such scenarios could be as follows:
In the case of pitchers wearing bright color lenses that can distract the batter, the umpire can tell the pitcher to pull off the glasses while pitching.
If any player doesn’t wear sport-specific sunglasses, that can be very dangerous. Regular sunglasses are not shatterproof and can easily break if the ball hits the lenses. In that case, the umpire can order you to pull off the glasses. Buy original sports sunglasses to avoid such embarrassing situations on the field.