What does a company pay corporation tax on?
On its taxable profit: trading income, plus investment income and chargeable gains, less allowable expenses and capital allowances. Not on turnover, and not only on money you take out — retaining profit does not defer the company's tax on it.
Directors' salaries and employer National Insurance are deductible, so they reduce the profit the company is taxed on. Dividends are not — they are paid out of profit that has already been taxed, which is the whole reason the salary and dividend split is a decision at all.