Avoir beau is a verb that has nothing to do with “beau” (handsome, beautiful) and is always followed with a verb infinitive form: Avoir beau + inf.
The meaning is: to make some efforts for something in vain!
On a beau dire, c’est comme ça! whatever we say, it is like that.
As you can see there is an opposition between the two parts of the sentence and we also could say:
On peut dire ce que l’on veut, MAIS c’est comme ça.
Elle a beau essayer, elle ne réussit pas: whatever she tries to do, she has no success.
On a beau dire, il n’est pas si bête: whatever people say, he is not so stupid.
Tu as beau dire, ce n’est pas si facile: whatever you say (and even the opposite), it is not that easy
J’ai beau faire, je n’y arrive pas: Whatever the efforts I make or I am making (whatever I do, no matter how hard I try), I can’t do it.
J’avais beau lui expliquer, il ne comprenait rien: Whatever I could say to explain it clearly, he could not understand.
Of course, nothing to do with “avoir beau temps”: to have a nice weather!!!! because sometimes we just say “avoir beau”!