Great question — answering as the UphillTech team:
Whenever the basketball is intentionally hit by the leg/foot, a violation will be called. If a player uses a foot to prevent the ball from going out of bounds, it is a violation. If a cross-over hits the leg of an opponent intentionally, it is a violation. So, if the ball is blocked or hit intentionally by the leg or foot a violation might be called, no matter if you are defensive or offensive. Not sure why more ball players do not use this to an advantage...it is much like being a goalie on the basketball court.
Full answer by BREEZ: https://sports.stackexchange.com/a/28987 (CC BY-SA 4.0).
Need it done for your business? UphillTech.