Communism and socialism always fails and has to adopt some capitalism into their system to survive.
However, there is no such thing as pure capitalism. Even within highly capitalist systems the government still operates the military, the schools, the infrastructure, the police, and other major functions of society.
Most likely outcome for capitalism: Capitalism creates a growing disparity between classes. The top 1% gains a growing disparity of wealth until the working class protests. The protests gain increasing support until the government intervenes and establishes more of a balance between executives and the working class. Capitalism continues.
Technology may eventually end capitalism. If artificial intelligence makes machines so powerful that machines not only do the work, but also plans the economy. Robots replace doctors, executives, general workers, and just about everything. The government collects taxes by taxing consumption, a carbon tax, and VAT taxes. The money from these sources would then be used for a universal basic income, and distributed to everyone.