As far as I know the territory of the country's embassy is considered to be the country's territory. So, is it legal, for example, to smoke weed on the territory of the embassy of the Netherlands (or any other country, where marijuana is legal)? The question is just to satisfy my curiosity.
As far as I know the territory of the country's embassy is considered to be the country's territory.
That is a common misconception, but still wrong. The diplomatic status of the embassy limits access to the embassy for official representatives of the host country, but it does not change the territorial association of the premises or the validity of the host country's laws.
For example, in the Dutch embassy in London, UK law applies, but UK police is not allowed to enter the premises unless they are allowed to do so by the ambassador.