Yes it is safe. But if to be honest they are not many to compare and sometimes some of them hide it, or you can't recognize them easily. Probably cause of they are not so acceptable here so far. Any way it is Muslim country, need to be little bit careful..
There are a lot of gays in baku.. they are out there but they dont play romeo and juliet in broad day light.. I see some of them at clubs and mid night walks.. its mostly indoor romance bro.. have a safe trip though..
Its always safe no matter what or who you are.But better keep your gay feelings in your heart because this country is not ready for gay friendly society.