All of Morocco is very hot in July, but it's certainly going to be hottest in the Sahara.
A few years ago the advice was 'don't', but with air conditioning now widespread it's not as hard as it was. Remember, though, that even with the AC the temperature is going to be around 80 degrees F; without it you are well the wrong side of 100.
You can experience camels, but you are best off setting off to your desert bivouac after sundown, and returning just after sunrise. It's still a spectacular experience. After all, the trans Saharan camel trains of lore used to travel at night in hot weather, and lay up during the day.
You can get to Merzouga in a day on the road (actual driving time is about 10 hours). M'hamid is a little closer but the dunes are another 2.5 hours of rough tracks. Breaking the journey with a night in the cool Atlas is recommended.
Make very sure that you have good AC in the vehicle before you leave (this means test it yourself), and make sure the driver switches it on. There is an increasing tendency not too, as it burns fuel. If you are using an auberge, make sure they have AC. If you are camping out, forget the tent and get your room set up outside.