Could two identical or slightly different planets (or planet-like objects if you want to be pedantic) form a binary pair that then orbit some other larger gravitic object (like a star)?

I was inspired by https://space.stackexchange.com/questions/12189/could-twin-planets-exist-and-share-the-same-orbit which I thought initially was asking the question I'm asking, but wasn't.