A problem with using a pasture is that as soon as any bears leave the pasture (fleeing or attacking), dwarfs rush in to re-pasture them. You need to mark the pasture inactive to avoid this.
And, when it comes to fear, there seems to be a body-counting calculation, of both alive and dead bodies, within the line of sight. So, if 10 bears see 50 siegers, the bears are more likely to flee. If 50 bears see 10 siegers, the siegers are more likely to flee, and if there is a pile of dead bodies that look like the dogs or the siegers, that will effect their fear-level also. I suspect this is where war-training and military-training help reduce these two effects. Also, creatures that are fleeing or unconscious seem to not count, so it you have 20 bears and 10 of them are already fleeing, the other 10 will not count the fleeing 10 as nearby allies in the fight (this is my opinion from watching small and large mobs encounter each other, and attempting to understand what events indicate what results).
An example, I had an entry into the fort that was a 10-wide corridor, shaped like an "L", and there was a 15x15 room at the elbow of the "L", with war dogs in a pasture and the room's gate closed.
f X=corridor
X f=fort, d=dog room, e=elf mob
X
XXX e
d
Over 50 elf siegers, including many war animals, entered the L corridor. The dog pasture was set inactive and the room's gate was opened. There were 80+ war dogs in the room. A few dogs entered the corridor as they moved towards the fort's meeting areas, they saw many siegers and ran in terror. As siegers rushed the dogs and moved in front of the dog room, many dogs saw a few siegers and moved into the corridor. But, there were already dead dogs on the floor and many of the new dogs in the corridor saw the many siegers and panicked, and by the end, most of the dogs were butchered while they were in fear and only a few siegers were dead. Being trapped with nowhere to flee to does not seem to caused frightened creatures to fight back. In the end, I assessed that releasing 80 war dogs from a cage would be more effective than releasing them from a room.