I've learned that a resistor converts some electrical energy into heat energy while the current flows through it and thus causes a power loss, but what if there's not any resistor in a circuit. Will current still flow?
Typically, yes: current will flow as long as it has a path with finite resistance (even zero), a voltage difference, and a supply of charge carriers (e.g., electrons).
If there really were no resistance in the circuit, the electrons would go around the circuit, and arrive back at the beginning of the circuit with as much energy as the potential difference (the voltage). That final energy is usually what is dissipated as heat or other types of energy by the circuit. But without resistance (or inductance) it won't have a chance to lose the energy, and will return to the voltage source with lots of energy, which will typically screw up the voltage source. This is kind of like a short circuit.
However, in any realistic circuit (including a short circuit) with any realistic voltage source, you will always have some resistance, even if you do not have something specifically designed to be a "resistor". For example, even a normal wire has some resistance. That resistance is so low that we usually ignore it, because other things in the circuit usually have far larger resistances, so it's usually a good approximation to ignore the wire. But when it's just the wire, you can't ignore its resistance. Current will flow, and since the resistance is low -- though not zero -- you will just get a really large current. This will heat up the wire just like any resistor (as you know). And typically that will cause problems like melting the wire or its insulation, or just starting a fire.
But suppose you used a perfect superconducting wire. Well even then, any realistic voltage source still has what's called "internal resistance". You need to add the voltage source's internal resistance to the resistance of everything else in the circuit to get the total. Again, this is frequently so low that we just ignore it -- but we can't when the circuit is just a superconducting wire and a voltage source. Of course, any realistic voltage source will also have a limit to the amount of current that it can supply, as Wikipedia will tell you. But if you really minimize the resistance of the total circuit, then you will typically maximize that current.
Short answer yes. The current will flow through the wire. We ignore this when there is a resistor because the resistance in the resistor is much higher than through the wire.
There are a couple things at work here.
In reality it is not clear what you mean by "let's say there isn't any resistor" because then it is unclear what the battery is connected to. Thus I am going to go on a tangent and explain these things so you understand better.
Firstly When we say current flows through a wire and into a resistor we abstract away all the unnecessary information and focus just on what helps us solve the problem. The problem being how does a resistor affect the voltage, current and power in a wire. Since under normal operating conditions this is pretty simple we use ohms law (and KCL,KCI) to solve for this system.
Secondly All things tend to prevent the flow of electrons from a sink to a source. For instance let's say you have a battery. There is no current flowing from its positive to its negative end because both the air and the internal insulation of the battery are preventing current flow.
Back to your example. Let's say you have an wire connected to a positive and negative end of a battery. The current will flow through the wire to the negative end of the battery. Since the resistance of the resistor is much higher than the circuit with just the wire and since resistance in series add, most of the voltage drop will be across the resistor so we do not have to worry about the voltage drop across the wire. Thus we never talk about current without a resistor even though it would be there and in fact the wire would act like a resistor.
For simplicity, let's work in the context of ideal circuit theory where ideal wires have precisely zero resistance.
Here's a simple circuit with only a current source and a wire.
In this circuit, there is a 1A current circulating clockwise around the circuit.
So, the answer is yes, there can be a current in a circuit without a resistor.
The concept of a resistor is very simple: it is a circuit element where the voltage across is proportional to the current through.
Resistors are used in a variety of ways including:
(1) developing a voltage proportional to current
(2) limiting current through a circuit
(3) dropping voltage from a higher level to a lower level (see "Voltage divider")
(4) dropping current from a higher level to a lower level (see "Current divider")
There are many others but these examples should get you started.