Even during WWII Germany had to synthesize much of its hydrocarbon fuel.
Also after the war there has been large-scale production of synthetic hydrocarbons, but eventually this was abandoned due to the low price of fossil oil.
It is possible to synthesize hydrocarbons from syngas, which can be made from carbon dioxide and water, with solar energy. If the carbon dioxide is extracted from air, that requires much more energy than when a concentrated source of CO2 is available, but with essentially free solar energy it would still be feasible.
Obviously, this will not be done as long as cheaper fossil hydrocarbons are offered. However the use of fossil hydrocarbons for plastic, asphalt or other applications that do not release CO2 is not harmful.