Yes you can use some dielectric grease on battery terminals to prevent corrosion on the battery terminals and keep the battery connections working properly.
I use dielectric grease on my battery terminals and since I've started using the dielectric grease on my battery terminals and battery cable connections the corrosion has not been as bad as it was before.
I still sometimes get a bit of corrosion but not as much as I would have before using the dielectric grease on the battery terminals.
Vaseline works good on battery terminals as well but the dielectric grease works better and gives a better electrical connection.
Another way to prevent corrosion on battery terminals is to use some anti-corrosive spray which works great and sometimes even better than the dielectric grease or Vaseline.