No, AI can't cast Berserk spell, but it learned it in HotA - Did you know nr. 61 - Heroes 3 Comlete
Berserk is a 4 level spell in the School of fire magic. It is one of the mind spells, and therefore some creatures are immune to it.
Buy GOG Games and support Heroes 3.5 Portal via this link: https://bit.ly/GOG_heroes_3_complete
It makes the target of the spell to attack the nearest troop whether it is an ally or enemy. This also includes war machines. If the creature cannot attack anyone, the spell expires after 255 turns.
AI cannot cast this spell. Fixed in Horn of the Abyss.
Artifacts rendering your units immune to berserk:
Badge of Courage (Heroes 3 Complete only) and Pendant of Dispassion
Other Videos By Heroes 3.5: WoG Portal
Other Statistics
Heroes of Might and Magic III Statistics For Heroes 3.5: WoG Portal
Currently, Heroes 3.5: WoG Portal has 2,812,158 views for Heroes of Might and Magic III across 963 videos. This game accounts for over 2 days of watchable video on his channel, roughly 56.13% of Heroes of Might and Magic III content that Heroes 3.5: WoG Portal has uploaded to YouTube.