Can sleeping with earplugs create risks such as not hearing smoke detectors and alarms?

Depends. If you can hear your alarm clock with your earplugs in, then i would assume you could hear the smoke detector which is usually louder. I suppose, to be absolutely safe, you could arrange for someone to set it off while you are sleeping.
Why earplugs? Why do you wear earplugs? Do most sounds at night keep you awake? You could maybe get some type of smoke alarm with flashing lights if it is a concern. Maybe train your self to use a sound machine without using ear plugs.