Ferroelectric oxides exhibit strong coupling between structural, electronic, and optical properties, which enables their use in photonic, optoelectronic, and quantum technologies. These couplings are investigated from first principles in two complementary directions. In the first part, a real-time formalism is developed to simulate nonlinear optical processes such as sum and difference frequency generation (SFG, DFG), enabling the calculation of coherent anti-Stokes Raman scattering (CARS). The approach extends the time-dependent Berry phase polarization method implemented in the Yambo code and allows the decomposition of the total polarization into distinct frequency components. This formalism is examplarily tested on hexagonal boron nitride (h-BN) and molybdenum disulfide (MoS2), predicting their strong excitonic features. In the second part, the focus is on ferroelectric oxides, specifically lithium niobate (LiNbO3, LN) and lithium tantalate (LiTaO3, LT), under uniaxial stress. These materials are key components in nonlinear optical devices, where an application of strain strongly influences their optical response. Domain walls (DWs) play a crucial role in this context. In a first approximation, DWs in LN can be modeled as stressed bulk material. The structural, vibrational, electronic, and optical properties mostly of LN under uniaxial stress are studied using density functional theory (DFT). Phonon modes have a nearly linear dependence on strain, and the splitting of degenerate E modes under xand y compression directly reflects symmetry lowering. The computed strain-dependent nonlinear susceptibilities show that new tensor elements appear under uniaxial stress, consistent with observations of second-harmonic generation (SHG) contrast at DWs. Subsequently, the CARS spectra are calculated under stress applying the real-time approach from part one. Furthermore, the investigation of point defects show that the formation energies of NbLi antisites, small bound polarons, and bipolarons decrease under strain, offering a microscopic explanation for the enhanced conductivity observed at DWs. Overall, this work establishes a microscopic understanding of how strain and symmetry breaking influence the vibrational, optical, and electronic properties of ferroelectric oxides such as LN and LT.