Most of the world handles international flights separately without needing to do that unless it is an international-domestic connection.
However I agree that in purely domestic airports I don't see how you'd prevent general public from accessing bags. Except India, wherein you need a booked flight to even enter the airport.
> I don't see how you'd prevent general public from accessing bags.
People are routinely prevented from being where they are not supposed to be. Whether you put the baggage pick-up point in a publicly accessible area or on a restricted area is a design choice.