The reason we are told to put on our oxygen masks before putting one on our child is so that we are then ready to care for the child - not so that we can put our own safety (and happiness) first.
We should certainly not forget about our own safety, that would be sheer stupidity, but to put on our own oxygen mask, collect our valuables, leave the child (minus mask) behind, and elbow our way to the emergency exit, trampling the frail and injured underfoot, is not really recommended.
There is a difference between loving yourself for what you are on the one hand, and on the other hand putting your own interests to the front in all circumstances. Recognising the difference and doing the first without the second is what makes a person humane rather than just human. It is also a reason not to put too much faith in all those, "You are an incredibly valuable person", self-help books.