I see this all the time, and they always get away with it. I know some don’t, but I haven’t photographed it (yet).
The birds seem to know when an alligator is safe to be around. The egret above almost danced on this ones head.
Here one landed right in the middle of them. Nothing happened. We get closer than is comfortable sometimes, but the alligators keep away, don’t like us. The birds, they are lunch whenever possible.