The short answer is yes. In fact the battery is being recharged by the alternator in your car whenever the engine is running. However, sometimes this isn’t enough, and your battery requires an external recharge. It’s best to ask a professional about this as you could void the battery warranty recharging it yourself.
External recharging is not always the best option as every battery eventually reaches a point in its life where replacement is the only answer to help avoid unexpected breakdowns.