Most dog doors from Closer Pets are lockable. There is usually a flip switch on the inside of the flap you can turn to keep the flap closed. Some dog doors with sensors can lock the door using a sensor.
If you’re getting unwanted visitors, you can use the sensor to only open the door when your own dog approaches. This can keep nocturnal visitors to a minimum!