You can add an Apple device, AirTags, or Find My network item to a new (ie, different) Apple ID.
To begin the setup process, hold the new device, AirTag, or Find My network item near your iPhone, iPad, or iPod touch. If the previous owner disconnected the AirTag outside of Bluetooth range of their iPhone, iPad, or iPod touch, you need to reset the AIrTag before you can set it up.
By the way, if you forget the Apple ID, you can use AnyUnlock to remove it.
(This how-to is based on my experiences and info on Apple’s support pages.)