Those third party hoods usually lack the flocking on the inside. If you like to DIY, you could replicate it yourself. It's hard to say if they are truly identical in make up. The OEM hoods will absorb the impact if you bump into something. The third party hoods don't always fit as well, and I haven't really seen someone praise their third party hood for saving their lens.
So flare prevention can be pretty close. Actual protection is up in the air. I bought OEM hoods because I didn't want to risk it. The Canon hoods are proven, and saving $30 isn't worth the risk on >$1000 lenses. On a $100 kit lens, I wouldn't mind the risk of a cheap hood, though.