This study investigates graphene-based nanosensors for oxygen (O₂) detection by examining geometrical and electronic structures, adsorption mechanisms, density of states (DOS), charge transfer, sensor sensitivity, and recovery time. Using density functional theory (DFT), we analyze monolayer graphene (MG), AB-stacked bilayer graphene (BG), and twisted bilayer graphene (TwBG) with a 21.78° twist angle, both in pristine and beryllium-doped forms. The results show physisorption in pristine structures and chemisorption in Be-doped configurations, leading to enhanced adsorption energies and improved sensor responses. AB-stacked BG exhibits lower adsorption energy, charge transfer, sensor sensitivity, and shorter recovery time compared to monolayer graphene, while TwBG demonstrates increased adsorption, charge transfer, and sensitivity, highlighting a molecular-tuning effect due to interlayer interactions. Among monolayer systems, Be-doped MG shows the highest O₂ detection capability. In bilayer systems, TwBG outperforms AB-stacked graphene in both adsorption energy and sensor sensitivity, regardless of Be doping. These findings position TwBG, particularly when Be-doped, as a promising platform for advanced gas-sensing applications, offering enhanced efficiency, adaptability, and performance.