No, it is not legal to use headphones while driving/riding as per the Motor Vehicles Act and is strictly prohibited.