If you want to keep this exact phrasing, you'd definitely need to insert the article the:
Of course, both are the same.
But the same does note that the two objects/qualities are exact replicas. So you might want to try a phrasing that leaves room for some differences:
Of course, both share similarities.
Additionally, be careful in using "of course" too casually or too frequently in writing. It has the same effect as the word "obviously" when used too directly. If it's so obvious (of course), why is it worth noting? Often the phrase can be eliminated, and it actually gives more strength to your writing or argument:
The two have similarities.
You could even use a modifier with similarities to give the phrase further strength:
The two share striking similarities.
The ideas have significant similarities.
The buildings have structural similarities.
The players share historical similarities.
The modifier could provide a transition to allow for you to shift the focus to your next segment of writing.