The rules don’t really say; gestalt is a variant that’s pretty well fleshed-out, but it’s even less comprehensive than the usual rules.
Generally speaking, there’s no reason it can’t work. Particularly for a non-player character, where LA doesn’t come into play, you can just gestalt it with Monstrous Humanoid RHD. It will be fairly effective without being as devastating as having both all those RHD and all those class levels (i.e. many more total HD). It’s a quite appropriate way to power up a monster without making a lot of math wonky by inflating coincidental numbers.
But the rules don’t actually suggest or recommend this approach (or suggest or recommend against it, for that matter).
As for CR, that’s a nearly-impossible question to answer. I’m reasonably confident that I could find CR 3-4 monsters that could keep up with this guy (allips and That Damn Crab come to mind), and also reasonably confident that I could find CR 10-12 monsters that he could handle. Meanwhile, 6th-level parties could potentially founder on those CR 3-4 monsters, or kill even things CR’d higher than that 10-12 range. CR is, effectively, useless, because there’s no standardization.
For this case, are we claiming that a Fighter 6 is a CR 6 encounter for this party? Most parties I’ve been in would make short work of a Fighter 6 even at levels well below that (quick, four Will saves, fail any one and you’re out of the fight!), but nominally it’s a 6th-level character. For the sake of giving some answer, I’ll assume it is.
So what does being an ogre add here? Large size, which is awesome, +5 natural armor, which, fine, OK, and... that’s about it. If you use the elite array, some really solid ability scores, but lacking the Intelligence to take Combat Expertise and therefore Improved Trip (unless he dips Wolf Totem Barbarian 2, which would be awesome for him). With Large size and no trip, I’d want to go with Dungeoncrasher from Dungeonscape, grabbing Power Attack, Improved Bull Rush, Knockback (Races of Stone), and Shocktrooper (Complete Warrior).
He now can potentially do huge damage if he shoves someone into a wall, and he gets a free bull rush on each attack. Easily looking at around 70 damage on a charge or regular bull rush since you can safely Power Attack for full in those cases, and 60 damage on a regular attack (with the possibility of an iterative), assuming that he can’t reliably hit while Power Attacking for full. But that damage is contingent on slamming things into walls. Aside from bull rushes, he has no ability to control the battlefield, which means a smart group can deny him the ability to land that damage; typical attacks are going to be more like 20 damage, up to about 35 if Power Attacking becomes an option (e.g. on a charge).
Since landing both iteratives is probably unlikely, and a single dungeoncrash hit probably won’t kill in one, that could make the fight an interesting tactical encounter in the level 6-8 range. Or it could be brutal because there aren’t good options for avoiding the dungeoncrashing, the party isn’t prepared to protect squishier assets, and so on. Or it could be a cakewalk because the party immobilizes him well away from any walls and just destroys him.
Ultimately, I would CR this encounter based on how many times I expect a character have to weather a dungeoncrash hit, and look for HP values based on that. For my parties, I’d expect them not to let him do it twice, so I’d want them to survive the first hit but die if they were dumb enough to let him do it twice. You might want to give a little more leverage based on how quickly you think they can evac whoever took the hit, and how capable they are of preventing a second. For two-hit kill, probably around CR 6-8 like I said. For a three-hit kill, probably around CR 10, though I’d boost his health and saves for that. His damage is too high to allow more hits than that at levels where he could even conceivably be a threat.
If you don’t go with Dungeoncrasher, his damage goes down dramatically, and it eliminates any real hope of getting a particularly tactical encounter out of this. Then it just becomes a calculus of how many hits you expect the party to have to take in order to put him down, and CRing him based on that. Hopefully they haven’t got any clever battlefield controllers.
For players: LA
For the record: when a player in a gestalt game wants such a character, the question of LA has to be addressed. This is somewhat awkward. But in my experience, and I’ve played in many such games, simply putting the LA on “one side” of the gestalt works well (though it will be inconsistent with NPC gestalt characters built as above), since most monsters are over-LA’d and the gestalt devalues the effect. In most cases, it’s still underpowered, though of course exceptions abound.