It is possible, although it is generally not considered a good practice.
WAN providers used to use different protocols for WAN circuits (frame-relay, HDLC, PoS, etc.), so a router was needed to connect the differing network types.
Now, more commonly the WAN providers can provide Ethernet circuits between sites. So in theory, you could connect two switches together across long distances. But there are problems:
When locations are connected at layer 2, they form a single broadcast domain. This is also called a failure domain because many issues, such as broadcast storms, loops, etc. will bring down every device in the failure domain. If sites are part of the same domain, then a problem at one site can bring down the entire network. It may not be obvious at which site the problem lies, requiring you to travel to each one to resolve the issue. By breaking up the network into smaller layer 2 domains (separated by routers), you limit the scope of failures and vastly improve troubleshooting ability.
Second, WAN bandwidth is typically orders of magnitude slower than LAN bandwidth. Every broadcast frame must travel over the WAN. This can eat up a significant percentage of the WAN bandwidth, while not being noticeable on the LAN