As 2018, is Windows Phone dead?
Yes, Windows Phone is dead. Specifically, support for the latest version (Windows Phone 8.1) ended on 11 July 2017. It is likely that, as with the older Windows Phone 8.0, certain features will stop working over time as the necessary cloud services are changed or discontinued.
Windows 10 Mobile, on the other hand, is not quite dead. While active development of new features has ceased, it is still supported at least until December 2019 and will receive security updates and bug fixes until then (see here for more details). Also, end of support doesn't mean phones will immediately stop working.
Retail availability is a bigger issue, though, with stock of new models being very limited at most retailers. You may have to wait a while to get a good deal on the model you want, or consider buying a used or refurbished phone.
Can I count on Whatsapp working for +2 years?
WhatsApp has generally been pretty good at updating their Windows app, but that doesn't guarantee they'll stick with the platform in the long term. Unfortunately that's not something that either us or Microsoft can predict, and quite a lot of high-profile apps have either been abandoned or outright discontinued (although PWAs might turn that situation around).
Or should I forget about a Windows Phone and move to Android?
If you absolutely need WhatsApp, then that might be a strong argument for moving to a platform that is in no danger of becoming unsupported by it. It's certainly possible to have a MS-centric experience on an Android phone.
Could I install Windows 10 Mobile on a random (Android) phone?
To the best of my knowledge, that isn't possible. See this answer from a few years ago, it should still apply to W10M as well.