Yes, at least with the Model 3 you just need to leave it plugged in - it'll keep the main battery topped up from the charger, and the 12V topped up from the main battery.
The Model S - at least older ones - didn't seem to work that way and it was possible for the 12V to go flat if left for a long period, even plugged in.