Currently {{#property:P402}} can pull some OSM relations from Wikidata. It is only possible to do so for ways within Kartographer's maplink and mapframe tags. We should have a parser function (e.g. {{#osm:\d+}}) and/or Lua function returning an OSM object ID or multiple IDs in plaintext (e.g. (node|way|relation)/\d+(;(node|way|relation)/\d+)*) for template use (such as in the French Wikipedia template Bases géographiques).
OSM objects with Wikidata tag (11 Nov 2018)
all | 1,199,542 |
nodes | 593,392 |
ways | 302,556 |
relations | 303,594 |