As long as the car with the battery light on starts and runs and stays running then yes you can drive the car with the battery light on.
However the battery light coming on is telling you something is wrong such as your battery is going bad or your alternator is not charging correctly.
If the battery stays on then something is either wrong with the wiring, the battery or the alternator or other part of the charging system.
If your battery is older than 5 years then it's likely the battery and time to replace it with a new one and if it's the alternator it will need replaced.
You can take your vehicle to Autozone or Oreillyauto and have them do a load test on your battery to see if your battery has a dead cell in it and needs replaced.