I had a dog that rarely ever got fleas when she was younger. My roommates dog would have tons of fleas, but Chewey never had any. That is, until she had Cushings Disease and Diabetes. Her immune system was so compromised (she also had Hypothyroidism). From everything I've read, fleas prefer weak/sick dogs rather than healthy dogs. I believe this, considering what I saw throughout Chewey's life.
I believe there is something called nematodes possibly that you can put in your yard. My friend did this several years ago and has never had problems with fleas since. You connect it to a hose or spray and spray the lawn with it. I believe the diamataceous earth can be sprinkled outside, too, but I think (not sure) it loses it's effectiveness when it rains.