Does Airbus buy Boeings and vice versa?
When a manufacturer is making an aircraft to compete with another manufacturer's products, they have the public marketing material to go off of, as well as what their customers tell them the other aircraft can do, and what they are looking to buy. The general performance capabilities and costs are what is most important at the high level of making a competing product.
More in-depth study does help for detailed information, and there are multiple ways that this can happen.
Manufacturers will end up with airplanes from other manufacturers through trade-ins. Just like with car dealers, they may offer to buy older aircraft from a customer as part of the sales deal for new aircraft. Unless they are headed for scrap, these aircraft are generally worth more intact on the used market than dismantling them but it certainly allows closer study.
Manufacturers can also look for parts on the spares market like any other buyer, and get specific parts of interest that way.
Information can also be found in safety bulletins or accident reports if a certain system or component is involved.