Second-order photonic topological insulators that host highly localized corner states resilient to defects, are opening alternative routes towards developing fascinating photonic devices. However, the existing works on second-order photonic topological insulators have mainly focused on either transverse-magnetic or transverse-electric modes. In this paper, we propose a dual-polarization topological photonic crystal structure for both transverse magnetic and transverse electric modes through topology optimization. Simple tight-binding lattice models are constructed to reveal the topological features of the optimized photonic crystal structure in a transparent way. The optimized dual-polarization second-order photonic topological insulator hosts four groups of corner states with different profiles and eigenfrequencies for both the transverse-magnetic and transverse-electric modes. Moreover, the robustness of these corner states against defects is explicitly demonstrated. Our results offer opportunities for developing polarization-independent topological photonic devices.