Yes, AR parts are interchangeable. But keep one thing in mind, viz. if you ever want to sell your piecemeal AR (in a normal economy), make sure your frankenAR is assembled with brand name recognizable components. I notice that such weapons on Armslist, etc, don’t get sold as well as others.
I have an M-1 Garand that I was trying to find the value of since I was thinking about selling it.
I talked to a guy who used to collect them, gave him all the markings on all the parts and stock and everything was going great until he asked about the markings on the rear barrel. When I gave him that info, he said that devalued the worth of the Garand considerably and that If I really wanted to get rid of it for the money that I should consider selling the parts individually......