When the Ogre reaches out to grapple you, his arm has entered your space, and provokes an AoO. A horse doesn't take up the whole 10x10 area all at once, but can attack through it by turning. The Ogre likewise. He occupies a 10x10 area, and can be attacked at any point within it.
So the Fighter doesn't have to be within 5'. He has to be within 5' of the 10x10 area. If the ogre reaches for him (with a hand, or a foot stomp, or whatever) the part that enters the Fighter's square is subject to an AoO whether the rest of him moves or not.