Writing what you know will protect you from certain sorts of criticism, but I suspect that writing vividly about what fascinates you whether you know anything about it or not takes you further in terms of entrancing the reader.
There's more to fiction than immersion, but immersion is a crucial starting point.
I'm especially interested in what writers have to say about this--I just read the stuff.
Addendum: My favorite critical theory is "Criticism, at its best, is an effort to identify the qualities which seem to accompany success". I don't know where I got it from, and the phrasing probably isn't exact. To my mind, it means that you always check your theories about what fiction needs against the fiction which seems to satisfy people in large numbers over a long period of time and at various levels of knowledge and attention. If the fiction is too recent for the long period of time, you take your best guess. I'm not saying this is the only possible measure of success in fiction, but any fiction which meets it is successful.
Any rule which is broken by a significant number of successful works of fiction should be modified to indicate what sort of fiction it covers or else written off as something that just sounds plausible.
Criticism which does detailed, funny savaging of fiction which deserves it might not be criticism at its best, but it's still worth reading.