One Hagar unit appears to be a fan controller, the other just a simple switch mechanism. If you have existing controllers, it may be possible for the existing controller to be installed in the wall and connected to the Hager switch mechanism. Ask your electrician.
If you are changing the controller You need to ask the fan manufacturer whether the controller is suitable for the fan. Different fan motors will need different controllers; if the wrong one is used, the speeds will be haywire.