Depends. Taking pictures in front of or around the planes is no problem, but majority are pretty much sealed off. That said, most of the bigger aerospace museums have several planes and helicopters with cockpit and cabin access.
I used to work at an airport listed in this reference actually. Their boneyard was fully behind the fence and no public access would be granted. Even as staff we never went there because you've got massive aging equipment.
It would be an untenable liability to be having around them especially the public. Some of the chassis were there for years.
Also if you’re talking specifically about the planes in the boneyards, would not recommend doing that in the desert. You will find some other “visitors” like rattlesnakes, scorpions etc. that have made the plane their habitat.