The prognosis for treating Lyme disease successfully is very good but the animal can get bit by an infected tick at any time in the future. This will set up another infection. In this case, will a humoral antibody response to a prior infection protect a dog? Maybe.
The key is to prevent the animal from coming into contact with ticks in the first place. By removing the tick with tweezers and twisting counter clockwise will usually remove the head parts also. The big problem is that the larval deer tick is very small and naked to the eye. Best approach is to use one of the topical flea/tick preparations such as Frontline® Plus, a Preventic® or Seresto® collar. Environmental control of tick populations can be controlled in the home with sprays or foggers. Outdoor environmental control may be done with chemicals but the best approach is to cut down tall grasses and weeds. This is where most tick populations will reside.
There is a vaccine for Lyme disease available. It needs to be administered once and than again in about 3 weeks. It is than boostered annually. Talk to your veterinarian about the use of the vaccine in your area of the country.