The roads are safe although it may take you slightly over 4.50 hrs to arrive, check for you local weather as well as travel advisories before you hit the road. Keep the drive during the day.
Yes Shivansh, it is pretty much safe to go to Haridwar via road, but I'd suggest you to check the weather beforehand if you are planning to visit in August as it is raining heavily everywhere.