It can matter a lot. You want the correct viscosity, for starters, especially for bearings. South Bend lathes, for example, typically have bronze journal bearings or something similar for the headstock spindle. The recommended oil has a viscosity of 100 Saybolt. Translating that into more familiar terms equates to about a #6 or #7 weight oil. If you put #30 in the bearings on the incorrect theory that heavier oil will be better...it won't be. The bearing shells won't get lubricated properly.
You probably also want a non-detergent oil. Detergent oils assume a filter is in the system to filter out particles in the oil. Machine tools, at least in "our" sizes, don't have oil filters. We want any dirt in the oil to precipitate out of the oil.
Another issue is water -- and another reason to NOT use engine oil. Engine oil is formulated to emulsify with water, because the oil gets hot, well above the boiling point of water, and the water will be driven out of the oil as it circulates. Machine tools don't get hot, so machine tools need an oil that is designed to precipitate water just as it precipitate dirt. Water in the oil can cause corrosion.
Way lubrication is another matter, but the type of oil is still important. "Real" way oil is formulated to minimize "stiction," the tendency of the oil to resist starting motion and hold, say, a lathe carriage from starting motion smoothly. And again, viscosity matters. Quite a few years ago I tried using straight #40 synthetic oil as way oil, on the theory that the #40 oil would float the carriage, there would be no metal-to-metal contact, therefore there would be no wear...Brilliant! Well, no. The #40 oil floated the carriage all right. The trouble was, the carriage floated so much that nothing kept it from moving side-to-side a few thousandths of an inch, which made accurate machining quite a challenge. I changed back to something more appropriate, and had much better accuracy.
You can buy the correct machine oils from places like
www.mscdirect.com and probably
www.travers.com or
www.mcmaster.com. You'll probably have to buy a minimum of a gallon, but even a gallon isn't terribly expensive and will last you "forever."
If you're determined to improvise, use the correct-viscosity hydraulic oil. It's quite similar to machine oil.
The main thing is to get the viscosity right.