I've seen diets like that (often with lamb included) not to prevent allergies but to prevent eating something you are allergic to. The idea is that the person is allergic to a large number of diverse things and is eating something allergenic every day. By wildly restricting the diet, two things will happen.
First, the rash or other symptoms will calm down and heal, the patient's discomfort will be lessened dramatically, and the patient will probably sleep better and become "healthier" with the pressure of the symptoms off.
Second, a baseline will be established to which other foods can be added. The patient can add their most important food first (eg everything I make has onions, let's find out if onions make me break out in a rash) or foods they believe are safe based on past experience.
You should never consider doing this without a doctor's support and advice. Over the matter of a week or two, I wouldn't worry about vitamin deficiencies, but discuss with your doctor whether supplements are a good idea. Protein is a bigger thing, so talk to your doctor about why there is no meat in the plan. You will get a little from the rice, but probably not enough. Eggs and dairy are things many people are allergic to, so I can see excluding those, but as I've mentioned the people I know who were put on this diet were typically told to eat lamb as part of it.
It is definitely a short term thing that you can retreat to when you are seemingly reacting to everything and your health feels out of control. Don't assume that anyone who suggests it is a quack. But don't assume that it's a safe way to live your life or that you should keep eating that way once your symptoms have subsided.
Page 25 of this PDF of a talk on elimination diets lists a number of studies on elimination diets in general. It is focused on eliminating things, and doesn't bring the patient down to just two foods, though.