Safer has a connotation of safety whereas ungefährlicher has a connotation of danger.
If something that would have killed you before, is less likely to do so now you would call it ungefährlicher or less dangerous but you wouldn't call it safer unless you're intending to be funny.
Not really a good explanation. Ungefärlich is more like "harmless" in English. Yes, it contains the word "harm", but there's a modifier that inverts its meaning.