Yes. This is typically an efficient way to get TPs. It may result in a lower Avios balance though. And if there are changes you will have to deal with IB rather than BA and that may test your patience somewhat.
And broadly the same for flying on AA, Alaska, Cathay etc. The only exception on IB - which won't apply here - are codeshares on Level and Vueling under IB flight numbers.