It's most likely a sewer clean out that was left uncapped.
Stick your nose over the hole and take a big whiff. If it smells like sewer then it's part of your sewer system.
I imagine you know if your house uses heating oil or not, but if it smells like oil then it's for heating oil.
If it's sewer then it goes the same place that all your house drains go. So if you are on septic then it goes into your septic system. If you are on municipal sewer then this also goes into your sewer.
My guess is it's a 3 inch pipe. Just go to Home Depot or Lowes and buy a new cap and screw it on.