If you want to sleep at night, knowing your washer hose could break or the outflow could spring a leak, it is definitely a good idea to install a pan underneath with a drain going (at least) outside to direct unexpected leaks out of the house. The alternative is to drain the pan to a basement drain or sump.
You should also check with your local building department. You may, or may not, find that such a pan is required by code in your city (probably not but still best to check. If so, they can give you their code requirements for the pan and drain.
There is much disagreement about the drain issue. (Google "Washing machine pan drain code") to understand the issues.
The most important issue, if you can't get guidance from your city building department, is that the leak be apparent to you. That's why draining it outside makes the most sense if it is not proscribed by local code. The drain should be carried all the way down close to the ground. About 12-18" above the ground. Don't hide it, or you won't see the leak.