You can bring an aerosol hair spray on your cruise ship. The confusion may be that, depending on the size, you are not allowed to have aerosol cans in your checked airline baggage. Even this is confusing because TSA does allow "personal size" in the checked baggage but no one has really defined what size is really "personal size."
If you're flying, don't bring the hair spray. If you aren't, go ahead an pack it.