In Pokémon Brilliant Diamond and Shining Pearl, it’s possible to obtain the Mythical Pokémon Mew as well as the Mythical Pokémon Jirachi upon visiting Floaroma Town, although you must have play records for certain Pokémon games on your system in order to receive them.
“Play records” are system data on your Nintendo Switch for your profile; this means you have played the mentioned game at least once on your system, on your profile. This does not mean you need an active save file; you should be able to borrow a physical card from a friend, pop it in your Nintendo Switch, boot the game up once, and that should allow you to get access to the corresponding Mythical Pokémon.
Additionally, you can get only one Mew and one Jirachi regardless of how many save files or play records you have of the aforementioned games (you don’t get two Mew if you’ve played both Sword and Shield, for example).
Getting Mew
You need to have play records on your Nintendo Switch system for either Pokémon: Let’s Go, Pikachu! or Pokémon: Let’s Go, Eevee! in order to unlock Mew. Assuming you have those records, you can talk to a madame in the southwest part of Floaroma Town, in the flower field, and she’ll give you a free Mew. Nice! No truck required!
Getting Jirachi
Similar to Mew, you need to have play records on your Nintendo Switch system for either Pokémon Sword or Pokémon Shield in order to unlock Jirachi. You can talk to a gentleman in the southwest part of Floaroma Town, in the flower field, and he’ll give you a Jirachi to take along on your adventure.