This study investigated the synthesis of hierarchically porous heteroatom-doped (B and N) carbon materials from CO2 or flue gas by CO2 conversion using NaBH4 as a reducing agent and their applications as supercapacitors. The resultant carbon materials exhibited a high specific capacitance of 210 F/g at 1 A/g, which is higher than that found in a typical activated carbon. This is because their hierarchical micro-mesoporous structure causes ions to diffuse into the carbon pores with low resistance. In particular, the process synthesizing B/N dual-doped carbon from flue gas reduces the capital/operating cost because the process does not involve an energy-intensive separation process of CO2 from flue gas. Therefore, the direct conversion of flue gas into B/N dual-doped carbon can lead to a sustainable practice of CO2 utilization.