Both sentences are fine, but there is a difference between the first sentence and the second one.
1- John is my friend. It's more specific and personal than the second one. John is a close friend and not just a distant acquaintance.
2- John is a friend of mine. It's non specific and John is not a particularly a close friend.
Interested in Language