Wi-Fi only iPad doesn't come with built in GPS and other positioning hardware (GLONASS, Galileo, and QZSS) which are available in current models of iPhone and Wi-Fi + Cellular models of iPad.
You can search the Web and find various wired/wireless (Bluetooth) accessories for your iPad that provide positioning functionality using GPS and a companion app.
I’m curious if an Android or iPhone could be used to share its GPS.
Generally speaking, an Android or iPhone can't be used out of the box as a GPS (positioning) accessory for your Wi-Fi only iPad. It is technically possible to create an app which will let you pair your iPad with a mobile device and view the positioning data, but the same can be done on the mobile device itself.