You can do ghusl at hotel, pray the wajib prayers, such as Zuhr and Asr, Maghrib and Isha, then you can go to haram for ziyarat, and stay till dawnm then return to hotel for ghusl and Fajr prayer.
If you want to go to haram after Zuhr and Asr prayers, you can, but you need to go back to hotel for ghusl and Maghrib and Isha prayers.
If prayer time took place while you are traveling, and the prayer time would finish before you reach to a place where you can do ghusl, then you need to perform Tayammum instead of ghusl, and pray.