No, it is not safe to burn just any kind of wood, because some woods contain toxins that have the potential to be fatal if inhaled as ash (poison oak, poison ivy). However, most wood found in nature is safe.
There's no such thing as smoke that won't cause damage to the lungs, smoke is a particle, your body has many levels of defense to try and prevent particles of anything from getting into your lungs (nose hairs, sinuses, mucus, coughing, sneezing), but they aren't exactly impenetrable defenses, a little bit of smoke won't hurt you, but avoid directly breathing the smoke from a fire.
As far as cooking over wood, while bad in your lungs, smoke can actually be very tasty on your tongue, of the four types of wood you listed maple would be the best to cook with because it will flavour your food as well as cook it. Best fish I've ever tasted while camping was cooked over a maple wood fire. Pine would be one of my last choices for a cooking fire, as well as any other soft wood, because soft woods burn faster and seem to release more ash into the air which ends up on your food.