Dinosaur fossils (Latin fossus, meaning ‘having been dug up’) aren’t made of bone, they are made from rock (silica).
According to Wiki there are 6 ways of achieving this, but I’ll only describe the permineralization process. First, the dinosaur had to die and be covered up pretty much immediately (such as sinking in mud) before the scavengers found it. As time passes, more sediment covers the remains and the flesh starts to rot away, leaving only the bones which decay slower. As they decay, groundwater carrying rich minerals seep into where the bone once was. Effectively it is a mineral replacement process with the replacing of ‘bone’ mineral with ‘rock’ mineral. Once the bone has all been replaced you have a perfect replica of the original bone, but now made from rock.
Thanks to Murphy, our beautiful lady golden retriever, for modelling for this cartoon.