I'm studying networking and one of the most basic things I've been told countless times is that computers can't communicate outside of their own subnet.
Stated without qualification like this, it is misleading and false. Of course, the Internet is divided between subnets, and yet anything can talk to anything else (most of them in an indirect way).
What you must have learned is that hosts cannot communicate directly over data link protocols like ethernet outside of their subnet, because a subnet represents some physical network segment. To communicate with hosts outside of the subnet, it is necessary to send a packet to a gateway which is on the subnet. This is what routing is all about.
Really, the question you should be asking is: how can an interface have an address such that all of the bits of the address are subnet, and there are no host bits?
The answer is that this is a point-to-point link. Point to point links are not full blown networks. The two interfaces on either end of a link know that they are talking to each other without the need for any datalink level addressing, and so at the network level, they can share the same IP address.
Moreover, a datalink can be regarded as its own network segment, and so it can have its own subnet, and that subnet only needs to contain one address.
If one end of the endpoint needs to talk specifically to the other, it can just use that address. If the router uses any other address and sends it over the modem, that packet is then not addressed for the peer; it is addressed to something else beyond that peer. The peer will receive the packet and route it.
Basically the ISP equipment is just configured this way: it has hundreds of incoming subscriber lines, and it gives each one a 32 subnet. If you have a point-to-point segment with one address, the netmask is basically moot, but you still need one: something has to be filled in for the netmask field on the interfaces and in the routing tables of the hosts.