Recent advances in nanotechnology have facilitated fabrication of various solid state nanopores as a versatile alternative to biological nanopores; however, effective transport of a single-stranded DNA (ssDNA) molecule through solid state nanopores for sequencing has remained a challenge. In particular, the nonspecific interactions between the ssDNA and the engineered nanopore surface are known to impose difficulties on both transport and interrogation. Here, we show that a two-dimensional (2D) nanopore patterned on an in-plane heterostructure comprising both graphene and hexagonal boron nitride (hBN) can be utilized to transport the ssDNA electrophoretically. Energetically, a ssDNA molecule prefers to stay on the hBN domain than the graphene one since the former has a stronger van der Waals attraction with the ssDNA, as demonstrated in both classic molecular dynamics (MD) simulations and density functional theory (DFT) based calculations, which leads to the confinement of the ssDNA in the 2D nanopore. Therefore, this nanopore enables the manipulation of the conformation of a highly flexible ssDNA molecule on a flat 2D heterostructure surface, making it possible for sensing ssDNA bases using the high resolution atomic force microscopy (AFM) or scanning tunneling microscopy (STM) in the third dimension (perpendicular to the 2D surface).