How to make square sides curved like Cylinder?
Start with a plane.  Tab into Edit Mode, select the face and press X and select Only Faces.  This leaves you with 4 verts connected by edges.

Tab out of Edit Mode and go to the menu item Object &gt; Convert To &gt; Curve.
Then in Object Data Properties expand Geometry and give it a Bevel Depth.

This should work for any continuous loop of verts.

It is possible to do this with more complex meshes, but they will require some work to look good since the corners only connect up on the longest continuous path.  Every other edge will be its own curve with disconnected control points.  Example: