Jacobson's organ (the vomeronasal organ) is a scent-detecting organ in the roof of the mouth that reptiles use to "taste" the air — which is why snakes and many lizards flick their tongues.
A tongue-flicking snake or a bearded dragon licking objects is gathering chemical information about its world, not being aggressive. It's completely normal exploratory behaviour.