A smoke detector (or fire alarm) is an essential piece of safety equipment in your vehicle, especially if you cook or heat with open flame. Mount it in accordance with manufacturer directions. A carbon monoxide detector is also important.
Place your smoke detector where it is less likely to trigger when you don't want it to ("nuisance alarms") due to campfires or cooking. Since a vehicle has such a small living space, you may need to disable the alarm when actively cooking. Be sure to make a reminder to re-enable it so it is not accidentally left disabled; for example, set the alarm on your pillow so you remember it before bed.