Does pieczny mean anything like dangerous? Bezpieczny=without danger, niebezpieczny: not without danger=dangerous? Or was this the case a long time ago?
The logic, surprisingly, is quite the opposite. "Bezpieczny" = "safe" comes from quite an old-fashioned, if not archaic, phrase "bez pieczy" - more or less, 'without care' ('piecza' doesn't even have a Polish wiktionary entry). The logic then was that sth is 'without care', because nothing endangers it, it doesn't need care, ergo - because it is safe. And that's how 'bezpieczny' was created, and from it - niebezpieczny, as its negation.
lol I thought that it was related to печь (oven) somehow (in Ukrainian it's also niebezpieczny)
I do not think there was ever a word "pieczny". But sjp.pwn.pl http://sjp.pwn.pl/szukaj/bezpieczny.html says that bezpieczny is from "bez pieczy" piecza=opieka without protection/care, as in does not need protection.
so it is not needing protection=safe=bezpieczny