Yes. A share of stock is literally a fraction of the (perceived) value of the company. That underlying value comes from physical assets (real estate and machines), and data and organization and workers. If they turn on the machines then there's value from the goods produced, and an operating factory is probably worth more than an idle one, if people want what the factory is making.
If there was an auction tomorrow to sell Tesla, my shares would definately not be worthless. Period. Whether or not a companyever intends to generate dividends has nothing to do with it. Many would argue that a company gives dividends when they are no longer smart enough to come up with a better use for the money.