I can't buy an itinerary consisting of just BA238 on aa.com but I can buy AA6981 which is its codeshare. I can also buy an itinerary where I fly AA on BOS-JFK and connect to BA JFK-LHR, because there's at least one AA-marketed flight on the ticket.
The marketing carrier also can affect how the operating carrier gets paid -- codeshares can have different inventory which allows airlines that are partners but not super close to hold back inventory for themselves.