Anchors on other pages

Can I link to an anchor that is on a different page? Or do anchor links have to exist on the same page as the linked object?