I've seen both, but I've usually used a tether so my dog could go inside if she preferred. A fence depends on the dog's training. Most of those fences are only waist-high, and some dogs can clear them w/o half trying.
But if your dog is trained, a fence like that just sets his perimeter, and he say, 'okay'.
I once saw a large, shiny new 42"/106 cm folding one at a yard sale, and there was a Class C parked in the driveway. I looked at the woman and said, "It didn't keep the dog in?" She shook her head and just said, "Beagle". No further questions required. (For those not familiary with the breed, a 12" Beagle can crouch at the base of a 6-ft fence, leap, hook his paws on the top, scramble over and he's gone.)
But once, I did see an unusual arrangement for two Miniature Poodles: it was just a waist-high (36"/92 cm) one, but they had attached about 6" of chicken wire around the top. Of course, I had to stop and ask. The man said both dogs were climbers, and their vet suggested the addition: when they start climbing and reach the chicken wire, it flexes inward and they drop back inside. I have used this technique on my 6 ft home fences to keep my cats on my property, and it works the same way. But useless for large dogs, I'm afraid.