Either box shape can be used for smokes The smoke alarm trim plate will not fit a 4″ square junction box, you must use an octagonal or rectangular ceiling box The important thing is the box capacity
First Alert Hardwired Photoelectric Smoke Alarm with Battery Backup
Make sure it is large enough.
Ideal for covering wall holes after removing fire alarms, smoke alarms, recessed lighting, ceiling fans, ceiling lights, round electrical outlets and more
For power or low voltage,. Seeless provides flush walls mounts & recessed mounting plates for outlets, switch plates, thermostats & smoke detectors for the trimless look of a modern home.