It may depend on the airline.
As to United and Lufthansa, two airlines I've divided flights on one leg on, and done it repeatedly, there is no problem. Just go to the lounge (Red Carpet or LH FTV/SEN as the case may be) and ask them to put the next flight on the particular program you want. They enter the information in their computer, print out a new boarding pass showing the proper program and (usually) your account number, and you're good to go.
I also did it once on BA (splitting between BA and AA) with no problem.
I've never tried it on SkyTeam flights, though (e.g., splitting between Delta and Air France).