Itβs not legal everywhere. For example:
https://www.votetexas.gov/voting/allowed-at-the-polling-place.html
persons may not use any mechanical or electronic means of recording images or sound within 100 feet of a voting station. A voting station is the area where the voter marks the ballot.