I'm no expert, but I would think overwriting the firmware would generally make the router "safe".
For it to not be safe, there would need to be some aspect of the firmware that is not overwritten, but still executed somehow. Something like a co-processor, or some convoluted flash arrangement.
But I don't think that would be the case, because that would almost definitely drive up the price. I can't say for sure, but that's my best guess.
The other potential vulnerability is that some devices have two flash regions, to be able to roll back in case a firmware update is bad (I had a linksys device with this configuration). So you might flash OpenWRT, but if the router gets reset a couple times (like with a power outage, for example), it could load the previous (commercial) firmware. There are ways to deal with it, but if you're looking to buy a new device, it'll be easy enough to avoid those cases.
For what it's worth, I've had great luck with OpenWRT on a number of TP-Link devices.