Seismic waves are influenced by factors such as the path medium and terrain during propagation, leading to changes in waveform, amplitude, and spectral characteristics, which significantly alter the dynamic response of structures. This paper combines the finite element method with ANSYS software to establish a three-dimensional refined model of masonry structures and numerically simulates the effects of seismic waves on masonry buildings. The study concludes that masonry buildings exhibit specific dynamic response patterns under explosive dynamic loads: when conducting seismic safety research on building structures, it is essential to not only reinforce horizontal seismic resistance but also address vertical structural vibration issues. The analytical results obtained using the proposed method are highly accurate, enhancing the precision of seismic dynamic characteristic studies for masonry structures and providing theoretical support for seismic design.