The anomalies in the electron-positron angular correlations from high-energy decays of 8Be were interpreted by the ATOMKI collaboration as evidence of a new beyond-the-Standard Model boson. A theoretical understanding of the nuclear physics involved is an important step towards verification of this claim. Hence, we investigate proton capture with the ab initio no-core shell model with continuum (NCSMC). The NCSMC describes both bound and unbound states in nuclei in a unified way, with realistic two- and three-nucleon interactions as the only input. This allows simultaneous description of 8Be structure, p+7Li scattering, radiative capture and internal pair creation which can individually be benchmarked against available data. We compare pair correlations to ATOMKI data for different proton energies and examine the effect of proper treatment of the initial scattering state. Further, our technique will be applied to the 12C and 4He systems in which similar anomalies have been reported.