Are fangames legal?
Technically speaking, no. If they desire, Nintendo has every right to request a Cease & Desist (C&D) from your project. If you are using Pokémon, their assets (tiles, sprites, fonts, etc), it is an infringement upon Nintendo's IP, and they can take legal action against you if you refuse.
That being said, as long as your game doesn't become to big or use completely different gameplay (like Evoas), they will probably not notice or care. Develop at your own risk.