A defence company which builds warships and nuclear submarines for the Royal Navy has launched an investigation after a fire broke out at one of its shipyards.