The relevant patents on Lego® bricks expired decades ago, and you would think clone bricks would have flooded the market by now. And yet Legos still sell—even the sets that aren’t licensed brands. My experience with Mega Blocks, cheaper bricks that are supposed to interlock with Legos, is that they don’t interlock very well—the tolerances are just far off enough to cause frustration. There must be something in Lego’s manufacturing process that keeps their quality high even though, on paper, nothing could be easier than replicating their technology.
Lego bricks are easy to replicate on current-generation 3d printers. It's nothing to do with the manufacturing process, it's just that making the molds a bit looser makes them much easier to separate, and cheaper. They also tend to round the peg size up to 5mm, when actual legos are around 4.9. This http://www.thingiverse.com/thing:1005 is a lego-compatible part designed from scratch that describes the issue. Using that, it's easy to make custom parts that attach to legos. Here's one that I designed and someone else printed: http://www.thingiverse.com/derivative:5042
There was also an attempt by Lego to trademark the blocks. That would have prevented competitors from creating compatible designs. However this was recently struck down by the European Court, http://www.independent.co.uk/news/world/europe/eu-judges-rul...
Execution is everything, even in something as apparently simple (it isn't!) as a lego brick.
The tolerances, the plastics used, the pigments, all add up to a quality product. The difference is so large that you can tell the 'real' from the 'imitation' just by looking at them, you don't even need to do a trial fit to see which one is which.