The only way to avoid that is if you decide to fold it before the flop. I don't play those
hands like 22, 33 or 4s unless its in late position and I can put a raiser on Ax Kx and I know they're not going to be able to get away from the hand if they hit and I get a good price to play. Moshman talks about the right price in the 30 day course here at Cardschat but I'll go even lower than that suggested price.
Those type of hands just aren't good because they're not going to hit a set on the flop like 90% of the time, then you're going to have over cards on the flop and it can be hard to know where you are in that hand. Does your opponent they have AK or AJ and cbetting the flop? I don't know but you're going to need to know your opponent's tendencies.
And think about it, who's going to pay you off even if you hit the set? An over pair in the hole? An average player isn't going too far with Ax missing the flop so you need a K, Q or an Ace to hit the flop as well as your set!!!! Its not worth it. Once you hit the flop and you have a set and the board doesn't have draws then you have to go with it and just take the cooler.
This all goes back to starting hands and preflop play. My point is it may not be the outcome as in this case of set over set that some folks focus on but on your hand selection. EVERY starting hand has a story and you can learn how the story usually ends by studying the game.
A golden rule in omaha isn't to play small pairs because this happen. Its not omaha but set over set happens. I had a hand recently where I had AA, somebody had 5s, another 9s and the somebody else other a big card flush draw of either JQs or something.
The bottom pair, hits a set on the flop, the next biggest pair hits a set on the turn and I hit the biggest set on the river!! But the flush draw wins when my Ace hits because it completes the flush, lol. So it happens. Nothing you can do but rebuy if you can and just move on.