Additional attacks made using the full-attack action from a high attack bonus are determined only by your Base Attack Bonus. The rules for Base Attack Bonus say:
Each creature has a base attack bonus and it represents its skill in combat. As a character gains levels or Hit Dice, his base attack bonus improves. When a creature's base attack bonus reaches +6, +11, or +16, he receives an additional attack in combat when he takes a full-attack action (which is one type of full-round action—see Combat).
Emphasis mine. Your additional attacks are based only on your BAB. No additional bonuses to your attack bonus will change how many attacks you earn for taking a full-attack action.
Therefore, assuming you're making a melee attack:
- A character with a +12 BAB and +0 STR gets 3 attacks (+12/+7/+2)
- A character with a +9 BAB and +3 STR gets 2 attacks (+12/+7). His strength bonus does not give him an additional attack, because his BAB is less than +11.
- A character with a +12 BAB and -3 STR gets 3 attacks (+9/+4/-1). His strength penalty does not cause him to lose an attack, because his BAB is +11 or higher.
- A character with a +9 BAB, a +1 STR, and a +2 magic weapon gets 2 attacks (+12/+7). The bonus to his attack roll from the magic weapon does not grant him an additional attack.
- A character with a +9 BAB, a +0 STR, and true strike cast on them (giving a +20 to one attack) gets 2 attacks (+29/+4). The benefit of true strike does not grant them additional attacks.
Note that this does not apply to natural attacks, and that there are other ways to gain additional attacks on a full round attack, such as using two weapons, the spell haste, or the Monk's Flurry of Blows.
Your Reasoning is Correct...
... from a Rules as Written perspective:
Forcecage reads:
A prison in the shape of a cage can be up to 20 ft. on a side ... A prison in the shape of a box can be up to 10 ft. on a side ... Any creature that is completely inside the cage's area is trapped.
[Emphasis mine]
The note on space (pg. 191) reads:
A creature's space is the area it effectively controls in combat, not an expression of its physical size. A typical medium creature isn't 5 feet wide.
[Emphasis mine]
Therefore, since forcecage only describes the creature physically being inside the cage, and space does not represent physical size, a creature is trapped by forcecage if its body is fully within the cage, regardless of whether some of its space is outside.
To take your example (comment), a Storm Giant (MM pg. 153) is 26 ft. tall. It therefore cannot fit into a forcecage and therefore cannot be (fully) affected by the spell, regardless of whether or not its space is fully inside the cage. If the giant were to sit, or bend over, so as to reduce its height to under 20 ft., then it could fit inside, and could be trapped.
Physical size is everything, not controlled space.
Dragons
For this part of the answer, I am assuming that the measurements in the 3.5e Draconomicon apply to 5e.
The colour of the dragon is irrelevant in determining its size. The Draconomicon provides only a table of actual sizes by given size (tiny, small, medium, &c.). Although the table itself is huge (pg. 37), giving values for neck length, tail length, minimum wingspan, &c., I provide some of the more important values:
\begin{array}{c|ccc}
\text{Size} & \text{Body length} & \text{Body width} & \text{Standing height} \\
\hline
\text{Large (Young)} & 9ft & 5ft & 7ft \\
\text{Huge (Adult)} & 16ft & 8ft & 12ft \\
\text{Gargantuan (Ancient)} & 24ft & 10ft & 16ft
\end{array}
Note that all of the values here represent not the maximum possible dimensions (i.e. tail and head completely stretched out), but the likely dimensions during combat (i.e. tail and head in).
Thus we can see that only the gargantuan ancient dragons are unable to fit inside a forcecage. However, dragons are clever creatures, and may stretch themselves out if they recognise that forcecage is being cast on them.
Best Answer
Clearly, any weapon wider than a half-inch in any dimension can't reach through the bars at all. A half-inch is rather tiny; most broadhead arrows and crossbow bolts won't even fit through that. Blowgun needles and spells* are probably the only things you can get through those bars without custom designing weapons meant to fire or reach between such tiny gaps.
*and not even all spells, if they create a projectile of some sort that's more than a half-inch across; that's just approximately one and a quarter centimeters, if that's your preferred unit.