This is called “gene \times environment interaction”, and can be difficult to deal with in something as simple as twin models. There are ways to test for it, such as adoption studies, and newer methods using measured genetics (a list of a whole bunch of SNPs, like what you get from 23andme). G \times E interactions are something that people studying genetics spend a lot of time thinking about.
Intelligence and education level are correlated, and studies will often use education level as a proxy for intelligence, because education level is extremely easy to get from a single question that may have been asked on a study about heard disease (for example), that didn’t ask anything else related to intelligence. However, it is important to remember that they are not the same thing. Things like SES and racism may play a greater role in educational attainment than in intelligence.
Education level is also heritable. Which, again, just means that some of the difference between people’s education level is due to differences in their genes. Doesn’t mean all of it. Doesn’t mean that future education level is somehow fixed at fertilization or gamete formation. Also doesn’t mean that group differences in gene frequency are responsible for group differences in education level. It does mean that we can come up with “risk scores” based on your genes to predict education level, but prediction \ne destiny.