Today I found the venting pipe of air conditioner pump out hot air out of my house. I wonder if it will cause energy leak. If it's hot air, is it better to pump it inside my house?
No, it is not better to pump the hot air into your house. The vent is outside for a reason and by-code because it will also expel condensate (ie water vapor condenses out of the air when the pump compresses air.)
If you are worried at all about 'energy leaks' then ensure the drain pipe has an escutcheon and it seals tightly to the exterior wall so that drafts/cooling loss don't run up your power bill. You can use a paintable, water-tight, exterior caulk to seal the escutcheon to the wall, if necessary.
I'm going to assume you're running the heat, and you're losing some of it out of the ~3/4" AC condensate line. That would not be desirable. It's supposed to have a trap on it, ideally one that has snap caps on it to use as a clean out. E.g., an "EZ-Trap", which you could open up and fill with water if it dries out, to prevent heat loss.
Or make your own out of pipe. In the picture below, the AC unit would be on the right.
(source, How to Properly Install a Condensate Line Trap)
But if you're talking about the ~2" exhaust pipe that's pumping warm moist air outside, DO NOT feed it back into your house as that would be a CO hazard.