Yes, to a large degree. A child born to a stable 2 parent family where both parents have college degrees and earn a high income is much more likely to get into a good school than the child of a single parent who makes $10 an hour at Walmart.
And the children from disadvantaged backgrounds who make it into good schools do it mostly through luck, since intelligence is a byproduct of inheritance and environment. Even work ethic is mostly a learned behavior.