Yes, especially in newer cars with electronic ignition systems. A weak or dead battery may not provide enough power to release the electronic lock in the ignition, even if the key fits and doors unlock. Dashboard lights are often dim or off too.
Try jump-starting the car. If the key turns normally once power is restored, the battery was the problem. Replace or recharge it as needed.