Companies pay dividends to shareholders out of retained earnings. A company with negative retained earnings is said to have a deficit. It does not have any money in retained earnings, so it cannot pay out a dividend. To start paying a dividend, a company with negative retained earnings must generate sufficient revenues to make its retained earnings account positive.
When a company is profitable, profits can be reinvested in the business -- for example a company could invest its profits in a larger factory or in acquiring another business -- or they can be paid out to shareholders as a dividend. The decision to issue dividends is up to the board of directors. But if a company is consistently unprofitable, its retained earnings may become negative. In this case, the board of directors have no funds in retained earnings, so it cannot pay out dividends.