No, because no-one wants a home AP that only works if it's pointed at you.
You can buy directional APs if you want, but they're usually used for outdoor point-to-point links, or as sector antennas. e.g. I just installed one of these today: https://routerboard.com/RBSXTG-2HnD in a place that needed a signal far from where the AP was. Usually patch antennas (like this product) are preferred over Yagis for microwave links due to their smaller footprint, and capability of dual polarization in a single package.
Better is if your indoor AP can transceive in more of a "pancake" shape, like this: https://routerboard.com/RBOmniTikU-5HnD Note that's almost the same gain as this home-grown Yagi (7.5 dBi vs. 8.5 dBi) but with a more useful directionality.
Antenna gain is a function of directionality and vice versa. Patch antennas are also good because they have often very low "backward gain" but at the same time they are not very directional forward, so they are good to be placed in a corner of a room or near a wall.
It's not illegal per se, if you adjust transmission power accordingly. Router manufacturers generally don't use yagi because it's directional, requiring aiming, unlike omnidirectional dipole antenna. Modern wifi stations have much more sophisticated ways to increase range than passive antenna designs.
It's only illegal if you get net gain out of it[1]; if you turn down the power so that the maximum power transmitted in any direction is the same as before, then it's legal. You can get a small performance improvement by using directional antennas in this way as you reduce the received strength of off-axis signals which can reduce both multipath interference as well as interference from other stations.
It's not all that useful indoors though as 2.4 and 5GHz signals bounce off of walls really well so you lose much the directionality at the very first wall it hits.
1: Actually there is a total ERP requirement, but most routers with external antennas are already close to that requirement, so more than about 3dB gain will often put you over.
You can buy directional APs if you want, but they're usually used for outdoor point-to-point links, or as sector antennas. e.g. I just installed one of these today: https://routerboard.com/RBSXTG-2HnD in a place that needed a signal far from where the AP was. Usually patch antennas (like this product) are preferred over Yagis for microwave links due to their smaller footprint, and capability of dual polarization in a single package.
Better is if your indoor AP can transceive in more of a "pancake" shape, like this: https://routerboard.com/RBOmniTikU-5HnD Note that's almost the same gain as this home-grown Yagi (7.5 dBi vs. 8.5 dBi) but with a more useful directionality.