No. As a reaction attack, it can only happen after the spell has been cast. You can’t use Mage Slayer reaction attack to stop your character from getting hit by a fireball from a wizard about to cast that spell.