Yes, it does work for Masuda Method as long as you breed that Pikachu with a Pokémon of different nationality. Source: https://www.reddit.com/r/PokemonSwordAndShield/comments/kqc55z/does_the_free_pichachu_from_pokemon_home_work/