Practically anywhere you like although most people head for one of the public parks and look for a quiet spot to crash out.
There is no real danger of robbery or whatever. Lot of people will be doing it and maybe it's a good idea to crash out where there are others doing the same thing close by. Perhaps the best place, as it is the biggest, is the park at the Vuelta del Castillo. Not far from where the action is, yet reasonably quiet. At the old walls, The Redín, there is some green space. But be careful, you are sleeping on the edge of the city walls where there is a thirty-foot drop should you roll over too far. Perhaps better if you go through the old city gates (Portal de Francia) and find a grassy spot under the walls.
There is another quiet park at the Media Luna, although a bit short on grass. There are several other similiar places around the city [map] and the further away from the centre, the quieter it will be. There is another park not very far away from the city centre, between Donibane and Ermitagaña neighborhoods, just beside the Iruña Park Hotel, which is very quite: it is called la Vaguada.
In any case, a sleeping-bag is recommended. The nights will always get a good deal cooler in Pamplona even on very hot days. An underblanket also helps. Anyway, you have got the idea and this is not the place to give camping lessons to anyone.
If you have to sleep rough, a handy service will be the public showers. There are public baths at Eslava street (948 22 17 38) in the old part where you can have a hot shower/bath. Also at the Antoniutti park a little further out.
Remember that you can also go to a municipal swimming-pool (Aranzadi) and also be able to have a shower there.
Should you have to sleep out, it will be a very good idea to leave your pack or baggage in the Left Luggage (during Sanfermin) at the schools of Plaza de San Francisco (948 21 24 80), beside the Tourist Office.