What are the other ways of energy transfer apart from heat and work? In my physics textbook I've seen that heat and work are non mechanical and mechanical forms of transfer of energy. Why can't electrical or chemical or nuclear energy or energies like that be a form of transfer of energy? Why is it only heat and work?
 A: 
What are the other ways of energy transfer apart from heat and work?

Energy transfer also occurs when there is mass transfer. When mass moves from one place to another it takes with it its internal energy (kinetic plus potential energy at the atomic and molecular level).

Why can't electrical or chemical or nuclear energy or energies like
that be a form of transfer of energy?

Electrical, chemical and nuclear energy are different forms of energy which, in turn, are all comprised of some combination of kinetic and/or potential energy at the atomic and molecular level. These, and other, forms of energy can be converted or transformed into other forms of energy. For example, the chemical potential energy of the chemicals in a battery can be converted to electrical potential energy at the battery terminals.
For a given form of energy, there can also be conversions between potential and kinetic energy. For example, in an exothermic chemical reaction chemical molecular potential energy is converted to chemical molecular kinetic energy resulting in a temperature increase.
Heat and work, on the other hand, are mechanisms for transferring energy but are not themselves forms of energy. In the case of heat, it is energy transfer due solely to temperature difference. In the exothermic chemical reaction discussed above, the increase in temperature during the reaction can result in energy transfer to the cooler surroundings in the form of heat.
Bottom line: Electrical energy, chemical energy, nuclear energy, etc., are all forms of energy. Heat and work, on the other hand, are not forms of energy. Things do not "contain" heat or work. They are strictly means for transferring energy (along with mass transfer).
Hope this helps.
A: You could define several ways of energy transfer into or out of a system. Apart from work and heat, you could also have

*

*Mechanical Waves ($T_{\text{MW}}$), a means of transferring energy by allowing a disturbance to propogate through air or another medium. Examples include seismic waves and sound waves

*Electrical transmission ($T_{\text{ET}}$), involving energy transfer into or out of a system by means of electric currents

*Electromagnetic radiation ($T_{\text{ER}}$), reffering to electromagnetic waves such as light, crossing the boundary of a system, the rate of which is determined by the poynting vector

*Matter transfer ($T_{\text{MT}}$), involving situations where matter physically crosses the boundary of the system carrying energy with it. Examples include convection
You can find more examples and explanation regarding these form of energy transfers from John W Jewett's "Energy and the confused student : A global approach to energy", particularly this one, at the second page
Nuclear energy is a form of internal energy, which is a means of energy storage (not an energy transfer). Chemical energy is almost always associated with potential energy functions, which is also another form of energy storage.
Hope this helps.
A: Heat, (reversible) work and matter transfer are broad classes of energy transfer that enable us to frame some very general laws about the thermodynamic behaviour of systems. In particular the Second Law of Thermodynamics relies on the distinction between heat and work.
At the risk of circularity, we can define heat as energy flowing into or out of a system because of a temperature difference between the system and the surroundings. So the quite different mechanisms of conduction and radiation controlled by bodies' temperatures can result in energy transfer by heat.
The classic case of energy transfer by work is indeed a force moving through a distance as when a piston is moved into a cylinder of gas. If the system contains a heating coil and we pass a current through it from an external battery, we are again supplying work to the system – electrical work. [There is a catch here, though. The work is irreversible. It might as well be heat, and needs to be treated as such when applying the Second law.]
As for the chemical and nuclear energies that you mention, it is difficult to see these as energy transfers How are they to pass through the boundaries of a system? What is understandable is if they are already inside the system, for example the system might initially consist of a mixture of hydrogen and oxygen. So part of its internal energy would be chemical. If the hydrogen ignited there would be a change in the way the internal energy was constituted; much would now be in the form of kinetic energy of the molecules of hot steam. [I'm assuming that the container remains intact, and that heat has not yet escaped.]
A: As defined in thermodynamics, heat is energy that crosses a boundary of a system without mass transfer due solely to a temperature difference between the system and its surroundings, and work is energy that crosses a boundary of a system without mass transfer due to any intensive property difference other than temperature between the system and its surroundings.  So, work includes all non-temperature driven transfers of energy across a system boundary, excluding mass transfer, such as electrical work in addition to mechanical work (force causing movement). Note that neither heat nor work include mass transfer.
Mass transfer across a system boundary is another way besides heat and work for energy to enter or leave a system.  Thermodynamics addresses mass transfer by using an open system, one defined where mass transfer occurs across the system boundary.
A closed system is defined in thermodynamics as one for which no heat, work, or mass transfer occurs. Within a closed system, exothermic chemical or nuclear reactions can increase the pressure/temperature within the system, and in that sense are transfers of energy. Classical thermodynamics address such internal energy sources using heat of formation or heat of reaction.  We now know, thanks to Einstein, that such exothermic reactions convert rest mass to kinetic energy.  (That is, the rest masses of the products of the exothermic reaction are less than the rest masses of the reactants, and that difference is an increase in kinetic energy of the products over the reactants.)
A: I think it is preferable to say that heat and work are time integral of fluxes of energy due to microscopic (heat) and macroscopic (work) degrees of freedom external to the thermodynamic system.
Stated this way, work is not connected only to mechanical processes. And in thermodynamics textbooks, people speak about electric, chemical, ..., work.
According to this point of view, almost everything that is not macroscopic work is heat. The reason for the almost is that there is a third mechanism able to vary the internal energy: transfer of matter.
