If the charger is properly sized the answer is yes, absolutely.
The complete answer is slightly different, especially if your charger is not "properly sized". If your on-board DC loads are larger than your battery charger you can actually be discharging the battery even though the charger is running at full-bore. As an example we had a customer with a 10A charger on a 450Ah bank. On shore power he had an average 15.5A of load.. He was negative -5.5A even with the charger running at full-bore because it was not sized properly. A charger should be sized at a minimum of 10% of Ah capacity, after dockside loads have been accounted for, if that is how you will be using it.
Eg: 450Ah Bank + No Dockside Loads = 45A - 50A Charger
Eg: 450Ah Bank + 10A of Dockside DC Loads = 55A - 60A Charger
This article goes into much more detail:
https://marinehowto.com/installing-a-marine-battery-charger/