Twigs have structures called buds, leaf scars and bundle scars that can be different on different species. Thorns and spines can occur on twigs and are unique to certain trees. The twig pith can have unique "chambers" and/or have a specific shape. Twigs are a great marker if you know what to look for.
Other twig structures used in tree identification are stipule scars, bud scale and fruit scars, spur shoots and lenticels. Find a good twig key for best results. Virginia Tech's Dendrology Department provides a great tree key on the Internet.