The gov chooses to allow you too. However, since Heller, the Supreme Court has made clear, that is not a right.