same thing happened to my 2006 corolla. found out it was a blown fuse.
things to consider: -sensor on brake pedal -sensor on key ignition switch -fuses to those sensors.
some cars use a variation of these three things. if one fails the shift lever wont let you pull out of the park position.
sensors usually dont go bad. especially when they are inside the car away from the elments.
fuses can blow due to electrical shorts. depeneding on what kinda of car you can have anywhere from 1-3 fuse boxes. make sure you find and check all fuses.
fuse box locations: -under the hood. ive seen cars that had 2 fuses boxes under hood. -under the steering wheel. hard to locate sometimes because most will have black covers. -driver and/or passenger side kick panels.
*you can always use the override park lock button to release the shift lever from the park position. the button is usually located around the shift lever. there might be a cover over the button.