hardware cloth might not be enough to stop a terrier. Their bite strength is greater than that. We designed our pen with 1"x2" welded wire fencing with corrugated roofing on the bottom 2' of the pen. The wire because we were told that anything less wouldn't keep dogs or raccoons out. Our pen is currently moot since our chickens free range all day and are locked in the chicken house at night, but if we ever need it it will be secure. Even if we do get to the point where the chickens are locked in the pen, at night they will be secured in the chicken house because raccoons will pull a bird right through the wire, part by part, if they can get a hold of it.
Our current dog is a good one and is scared of the chickens, but we are about to get a new puppy and a new 10'x10' wire kennel. The new puppy is an English Pointer, a bird dog. We hunt so we want a good bird dog but we know that we can never let Finn (the pup) mix with our chickens without being closely supervised and on a leash.
To not fence one or the other securely would be a quick way to lose the chickens. We like our chickens to forage so the dog will be fenced. A dog is safer when it is contained anyways, you never have to worry about the road or what the dog might do to someone else's yard or neighbors.