We introduce generalized Demazure operators for the equivariant oriented cohomology of the flag variety, which have specializations to various Demazure operators and Demazure–Lusztig operators in both equivariant cohomology and equivariant K-theory. In the context of the geometric basis of the equivariant oriented cohomology given by certain Bott–Samelson classes, we use these operators to obtain formulas for the structure constants arising in different bases. Specializing to divided difference operators and Demazure operators in singular cohomology and K-theory, we recover the formulas for structure constants of Schubert classes obtained in Goldin and Knutson (Pure Appl Math Q 17(4):1345–1385, 2021). Two specific specializations result in formulas for the the structure constants for cohomological and K-theoretic stable bases as well; as a corollary we reproduce a formula for the structure constants of the Segre–Schwartz–MacPherson basis previously obtained by Su (Math Zeitschrift 298:193–213, 2021). Our methods involve the study of the formal affine Demazure algebra, providing a purely algebraic proof of these results.