Volt-Var Optimization (VVO) plays a critical role in Active Distribution Networks (ADNs) by ensuring voltage stability and minimizing power losses, particularly with the increasing integration of distributed photovoltaic (PV) systems. In this paper, we propose a decentralized control framework using Multi-Agent Reinforcement Learning (MARL), enabling PV inverters to independently control their reactive power to minimize power losses while maintaining voltage within safe operational limits. To mitigate unsafe actions, such as voltage violations and line overloading, a pre-trained Deep Neural Network (DNN) is integrated as a safety layer. The DNN projects unsafe MARL-generated actions into a feasible space, ensuring operational safety. Our approach is evaluated on a modified 33- bus medium-voltage test network across three scenarios: (1) a base case with no control, (2) MARL without a safety layer, and (3) MARL with a safety layer. The results demonstrate that MARL with the safety layer achieves the greatest reduction in power losses while ensuring voltage stability across all buses. This study underscores the potential of combining MARL with safety mechanisms to enhance the reliability and efficiency of ADNs.