I actually asked before even buying the bike. My commute is only 31M, but at the prevailing speed (70, in 55mph zone) it takes 2/3 or more of the 8.5Kwh battery. There was an outside outlet for a snowplow block heater. Well, if that's in use, I will not be using the bike! Once I knew I could plug in, I opted for the smaller, cheaper battery instead of the 11 Kwh. My silly-perhaps hope is for a 20KW replacement in a few years.
As indicated by someone else in an other reply, I also scout the premises first, as workers often do not know.
Then if possible buy an icecream, coffee or beer as appropriate and then ask to use the outlet as an established customer. Never been refused, and have been offered extension cable (through open windows at times).
If there is noone to ask, I'd just plug in leaving a phone number if I think about it.
(hmmm, reminds me of a bicycle I often had to leave for extended periods (weeks) in an office garage. I would use a number-lock to chain it to the wall, but left a transparent pouch with my name, phone and the lock combination code.
I figured if a 'bad guy' want to steal it, they'd probably cut the lock anyways without thinking. But if a custodian needed to move it, they could :-)