It’s always legal to bribe someone so long as it doesn’t interfere with what’s written in constitutional/local law. You can bribe a baby not to cry with candy, bribe a friend to do your homework, or even bribe someone to sleep with you. It’s treated as more of a compensation than lawless act. However, if such bribe is done to/by politicians or law enforcement officers it’ll be punishable by law as it has gone against their work ethics.