Even if you had a square sensor, composing for landscape and portrait simultaneously would require leaving a lot of room around the edges for cropping, which would cause you to "lose quality" for both formats.
Use the format most suitable for the target platform. If you really need multiple, incompatible formats, consider using a multi-camera setup.
Apparently square sensors are made and used in the aerospace industry, and many cameras do provide a 1:1 crop setting. However, I am unaware of any consumer camera that contains a native 1:1 sensor.
There are medium format cameras with a 5:4 aspect ratio.
The closest, commonly available format is 4:3, found in micro-four-thirds cameras, many medium-format cameras, compact cameras, and cell phones.
When the desired aspect ratio is known ahead of time, it's "best" to make a sensor directly in that aspect ratio to fit within the imaging circle. The problem with square sensors, when non-square, rectangular aspect ratios are desired, is...
A non-square crop from a square sensor that fits within the imaging circle would leave large portions of the imaging circle unused.
A square sensor that completely covers the imaging circle would have unusable corners. It would also have to be larger than necessary, which would increase manufacturing costs and defects.
A camera with such a sensor would likely also be unmarketable. Consider what would happen if a manufacturer put a medium-format sensor in a full-frame body, or a full-frame sensor in an APS-C body. Consumers would consider the unused sensor area and lack of lenses capable of using the full sensor to be defects.