It would work just fine. I've done this in an old 1980s Volvo 760 diesel (VW engine)- I happened to be coming home from grocery shopping, ran out of fuel, and was able to make it to a diesel pump by adding the half gallon of vegetable oil I happened to have purchased with my groceries. Noticeable 'french fry' smell but the engine started and ran like normal. Obviously those engines are less sensitive than modern ones, but I think this would be fine in any diesel for a very short emergency drive.
A modern common rail diesel engine will have some serious running on vegetable oil long term, but realistically, doing it just once in an emergency won't cause any problems. Even when ran "empty" you are looking at a substantial amount of diesel still in there that will dilute the vegetable oil, and the overall properties will still be pretty close to real diesel. Viscosity will be higher, but these fuel systems are already designed to handle high viscosity short term during extreme cold weather starts. As long as the oil is liquid, water free, and lubricates about as well as diesel it will work. Most problems with WVO are caused by dirty oil or water in the oil, but food grade brand new oil from the store will be extremely clean and dry.
One could likely also use engine oil for an emergency fuel in a diesel. I can't recommend it, but I'd imagine most diesels could survive removing half a gallon or so from the oil pan and pouring it into the tank in an absolute emergency. I'd need to be in a life or death situation to do that to any of my diesels, but I'd bet it would work.