Are there factories in China that produce raw LEGO-compatible blocks?
There are vendors that sell LEGO compatible blocks. One place to look for these is on AliExpress, which is an online marketplace affiliated with Alibaba, the world's largest retailer (wikipedia).



You can search around for what you want, but here are two sellers that I found as an example (1, 2).

Note that these don't appear to be significantly better prices than what you might find on a secondary LEGO market such as Bricklink, and quality varies a lot between brands, so I'd recommend sticking with Bricklink unless you are looking for massive quantities and quality isn't as important to you.

High quality LEGO compatible brick manufacturing requires very high mold tolerance and tight tolerances on the entire injection molding process. It isn't easy to do cheaply, and LEGO's scale allows them to be fairly price competitive on bulk parts among manufactures with similar quality.