You cannot use a dimmer switch on a fan motor but you can find fan speed controllers.
Can you put a ceiling fan on a dimmer switch.
An example of this is that the motor in your fan could be damaged and rendered useless.
The wall dimmer switch reduces power flow and interferes with the fan control.
Replace the wall dimmer switch with an on off switch.
If your ceiling fan has wiring already in place where you have a separate switch for fan control then you can have the separate controls wired to independent switches.
You may need an electrician for this.
A broken ceiling fan motor and a house fire are obviously not ideal outcomes however there is some good news.
In this circumstance the light kit could be connected to a dimmer switch and the fan motor connected to a toggle switch.
A dimmer switch as the name suggests lets you control the intensity of the light produced from the light to which it is connected such as a ceiling fan with a built in lighting fixture.