Yes, you can use a dehumidifier overnight. But be aware that the machine will always make noise while it is running. But you can get a quiet one that will not disrupt your sleep while it runs. It will not affect your health.
Check out our best pick dehumidifier Dri Eaz LGR Dehumidifier.