Originally one key fit all locks on AD trucks.
Your glovebox lock may not work because your key is worn and the lock has had little use.
The ignition lock gets plenty of use so the pins in it wear down at about the same rate as the key wears. So the worn down key keeps working it. But it's not going to go into the right position on that un-worn glovebox lock.