This is an interesting question because it's not just about marketing per se but also about contributing back to the community, and not focusing only on money.
First of all, there are other reasons for doing training or speaking sessions free (pro bono) besides marketing. It's an excellent way of contributing to your favorite causes or charities, perhaps in a way that is more long lasting than simply making a donation. It's a great way of meeting people, and you can learn more about other sectors (for example, if you work primarily for corporations, doing a free session for a local non-profit is very educational).
And of course it's a way of giving back to the community that also pays your bills.
Long ago I decided not to do pro bono work simply for marketing purposes, but to do them to contribute back to the community, and to contribute to the health of organizations I feel are important. Though I did free public speaking on occasion, more at the beginning of my business.
On the marketing side, there is nothing wrong with doing pro bono work and it's a way to get your name and talents out there. Oddly enough, it doesn't work for everyone. Which makes some sense since simply showing up and doing your thing may not be enough to make it a prime marketing opportunity. You still need to have the opportunity to shmooze, and network, and you have to be good at that and comfortable with that.
You also need to consider the possibility that doing too many pro bono sessions or appearances may devalue your work. That is a possibility.
On balance freebies are a potential source of business, but you need to maximize your benefits with more than simply showing up.