TL;DR - your PhD is a means, not an end, so it's a fail only depending on what you aim to achieve by it. Focus on the research, the rest will follow.
if I can't publish in such top venues then my PhD is practically a fail.
This really depends on what you're trying to get out of it. If you are seeking to land a position in a top university then yes - you will most likely not be able to achieve this goal if you don't publish in top venues. That does not mean that your PhD will be a 'fail'. From a strict academic perspective - hiring committees/potential postdoc advisors look for your potential to make an impact. The main signal for that is publications. But how many and what kind varies widely. I have seen hiring committees prefer a candidate with one or two big publications over one with 4-5 mediocre ones (which to me makes sense, but to others it may not).
How will my PhD be valued if I cannot publish in top conferences or high impact factor journal?
The honest truth is that if you are not able to show capacity for publishing in good venues, it will not reflect well on you. However it is not the end of the world. You can still successfully graduate if you publish in other venues and your manuscripts are interesting. However, the burden of proof will be on you - you'll need to show how your work matters and why it is good. This is much harder to show than simply neatly stating your top-tier publications.