speed control of ceiling fan using digital Potentiometer

I think you will find that most digital potentiometers need a 5V (or lower) supply, and that the terminals of the potentiometer can only be connected to voltages between the supply and ground.

This will rule out their use in typical mains powered triac circuits.