Oops
Yes as long as its in there and its not leaking oil its okay.
You have 2 options now! You can try and unscrew the sender from the housing and fit another sender or you can leave it in there as a blanking plug and go to 2nd option of fitting sender as an oil drain plug at the bottom of the sump!
This would obviously require you getting under the car and losing an engine full of oil! You'd also need to reroute the wire down to the underside of the car!
Make sure it is not leaking though so go for a 'spirited' drive and come back and do an oil leak check in the area! Clean up any old oil first though so you can 100% make sure its not leaking oil!
If it is, then i wouldn't really drive the car until you have sorted it out! The last thing you want is to be running your engine dry!