If you are driving in Hold mode (in a Model 3 or Model Y) the electric motors will hold the vehicle in position once the vehicle stops. There is no transmission in the Tesla vehicles so there is no parking pawl to engage and lockup the transmission. The only thing holding the Tesla vehicle from rolling once you turn off the vehicle is the parking brake (the parking brake sets the rear brakes only.) It is possible, under some conditions, for the Tesla vehicle to lose its grip at the rear and start sliding on snow or ice covered parking space or driveway when parked on a slope. This happens when the weight of the vehicle melts the snow under the rear tires, turns the snow to ice. Once the rear tires lose their grip on the ice formed under the rear tires the vehicle will start sliding whichever direction is down hill. For this reason you should never park a Tesla vehicle on a snow or ice covered hilly street or on a sloped driveway. If you park pointed down hill on a hilly street and turn the front wheels towards the curb this may stop the vehicle from continuing to slide if the rear wheels lose their grip on the snow and ice. Other than by impacting the curb the front wheels will not hold the vehicle back.
Detroit built rear wheel drive vehicles for decades, I don't recall any driver education training I received ever cautioning about parking Detroit iron on a snow covered hill or sloped driveway. I was taught to always turn the front wheels towards the curb (when parking, pointed down hill), in case the parking brake or parking pawl failed but never any special caution about the rear tires melting snow and losing grip on the resulting ice underneath the rear tires. Maybe it has to do with the weight of the vehicle. I'm hoping someone knows the answer.