Can the key fob inside a Tesla be used to lock it?  

This article explains how your Tesla's key fob and smartphone app operate to automatically lock the vehicle when you exit  

and walk away, but if the key fob is not detected, the vehicle will lock using its built-in auto-lock feature. -  

Fortunately, Tesla customers have the option to bypass this and lock their cars from the inside using the key fob.

Depending on the Tesla model, you might be able to lock your car doors using either a key app on your phone or a traditional key fob.

The majority of models come with a key fob that can detect proximity; as a result, if it is sufficiently close to the vehicle exits, it will recognise its existence and lock the doors.  

If this doesn't happen, you can manually lock them from outside the car by holding the key fob or using an app on your phone.  

Even without an app or holding a key fob, the more recent Tesla models may be able to detect that you are holding one and may lock themselves as you walk away.