The Deep Underground Neutrino Experiment (DUNE) is an international project aiming at neutrino physics and astrophysics and a search for phenomena predicted by theories beyond the standard model (BSM). The excellent imaging capability of Liquid Argon Time Projection Chamber (LArTPC) technology, particle tracking and identification utilized in the Far Detector, as well as the Far Detector size and underground placement, allow the experiment to achieve high sensitivity to various rare processes. BSM theories predict the existence of baryon number non-conservation effects, in particular when the baryon number changes by 2. Here we discuss the sensitivity of DUNE to neutron-antineutron oscillation. With full event simulation and reconstruction using the LArSoft package, we have investigated the background to potential signal events from atmospheric neutrino interactions and particle misidentification, and utilized machine learning techniques to enhance the discrimination between signal and background. The methodologies being developed for a high-sensitivity search for neutron-antineutron oscillation in DUNE can also be demonstrated with the currently running MicroBooNE LArTPC. We discuss progress on demonstrating the developed techniques with the first-ever search for neutron-antineutron oscillation in a LArTPC using MicroBooNE data.