Not the same era.
1. The two cartoons were started at different times and by different authors. One Piece was much earlier.
2. The theme described is also completely different. There is a world government in One Piece, so it should include all countries in that era.
The protagonists of the two cartoons will appear at the same time, just to increase the mutual influence of the two cartoons. It cannot be ruled out that the two authors have a very good personal relationship.