You can take the board your residency is accredited in, with some exceptions. Mine had dual accreditation (AOA the DO organization and ACGME the MD organization), so I could take both the Osteopathic Family Medicine board (AOBFP) and the MD Family Medicine Board (ABFM), which I did. Remember, the AOA accreditation for residencies is largely being replaced by ACGME with the merger over the next few years, and this is changing from ACGME vs AOA to ACGME vs ACGME with Osteopathic recognition.
I am continuing with the ABFM because I want to be a member of an ABMS board (American Board of Medical Specialties) which is the standard. However, In most instances AOA (American Osteopathic Association) member boards are just as standard. In my case, I can only enter a certain sub-specialty (Addiction Medicine) in the future if I am already board certified through ABMS/ABFM. Your particular situation will likely be different. You may want to be faculty in a Osteopathic medical school or residency, and you would want to be AOA certified. You may want to market yourself as someone who does manipulations or do a Neuromuscular Medicine fellowship where being AOA would likely be your best bet. You might have other goals as well.
The other issue is cost, which may or may not matter to you in the end. The ABFM is changing how they work, so I'm not sure the cost anymore. I think it may be $200-300 a year now. The AOBFP currently requires you to be a member of the AOA which eventually is around $600-800 I think. However, if you are doing ABFM you probably would be a member of the AAFP (American Association of Family Physicians) anyway which is a similar cost. On top of that, most jobs pay for all or most of these fees, and it doesn't matter. Mine is the minority that does not, so I am more sensitive to cost.
Tldr: The board you can take depends on the accreditation of you residency, many residencies are dual accredited, and don't forget the merger. Choose a residency that gives you the board that is most aligned with your goals if you can, but in the end either might accomplish your objectives.