This is an old technique called desensitization, or, if you want to be fancy, allergen immunotherapy.
Among other techniques, is this one
Allergy injections start with a very low dose. A small needle is used which may be uncomfortable, but not very painful. The dose is gradually increased on a regular (usually weekly) basis, until an effective (maintenance) dose is reached. This usually takes three to six months. This dose may vary between patients, depending on the degree of sensitivity.
Once the maintenance dose is reached, injections are administered less often, usually monthly, although still on a regular basis. Immunotherapy injections should always be administered in a medical facility under medical supervision. You should stay at the medical facility for the time recommended by the clinical immunology/allergy specialist (30-45 minutes) after the immunotherapy injection has been given.
And here's a oral trial in children with peanut allergy
Forty-eight children were enrolled in the PPOIT trial and were randomly given either a combination of the probiotic Lactobacillus rhamnosus with peanut protein in increasing amounts, or a placebo, once daily for 18 months.
At the end of the original trial in 2013, 82% of children who received the immunotherapy treatment were deemed tolerant to peanuts compared with just 4% in the placebo group.
Now the issue with doing this at home as you're asking is that you risk anaphylaxis and death if your allergy is severe.