user-1: If somebody does sin or bad karma, harms other living beings, but that person doesn't believe in karma and believes that karma is just an illusion. then how does his bad actions will harm him? For example, if I kill a mouse but I totally believe that nothing will happen, karma or religion is just people's belief, then will I ever be punished for that karma and such believe? Because there is also one saying that everything is just our belief? 
And also if I later ask for forgiveness to god for my bad karmas then will my bad karmas be forgiven? 

user111: This is a variation of Akiriya-ditthi which is basically having the view that there's no merit or demerit to your actions. This is one of the views with a fixed destination. Whether you harm someone or not, if you die with this view, you will have no other destination but hell.
Asking forgiveness from a 'God' will only compound one's ignorance as there is no God.
Reply to OP's comments:
It has a fixed destination as in if you die with that view in the mind, you end up in hell. But if a good Karma comes to the mind at the time of the death, you will go to a good place.  The three roots of evil are not always present. Ignorance is present in unenlightened beings when they do bad or good karma. But the term 'ignorance' is an umbrella term. The Pali word Avijja simply points to the lack of the understanding of the four noble truths. It does not necessarily mean having a wrong view like the one you talk about in the question. On the other hand, Micca Ditthi or having a false view is at a whole new level. 
Ex: Not knowing the cure for diabetes is one thing, but thinking that smoking is the cure for diabetes goes way beyond simply not knowing the cure. Not only it does not cure diabetes, it will make the situation worse. In the same way, simple ignorance just extends your Samsara, but wrong views put you in hells.

user-1: "Wrong view" is one part of Kammapatha, and one of the bad (unwholesome) mental aspects of courses of action, kamma. There are many types of "wrong view", and it seems that this particular one is unwholesome, whereas belief in a self is not

There are many kinds of wrong views and they are of different degrees.
  Three kinds of wrong view are unwholesome courses of action, akusala
  kamma patha, through the mind, and these are capable of causing an
  unhappy rebirth.

I think one can overplay the bad karma, rather than lack of liberation, associated with it, however, especially as people with "wrong view" can end up going to a higher rebirth in their next life.

Right view, by contrast, is both good wholesome (good karma) and part of the Buddhist path to nirvana.

user295: When you follow through with an actions the motivation can be either wholesome or unwholesome . If it is wholesome then the roots are greedlessness, hatelessness, undeludedness (alobha, adosa, amoha) and if they are unwholesome the roots are greed, hate, delusion (lobha, dosa, moha). These also are known as the cause as unwholesome volition results in unwholesome actions, if followed through, and vise versa. The wholesome and unwholesome states are like seeds. They grow and bear fruit. So when you have generate and wholesome/unwholesome state of mind this matures into pleasant/unpleasant experience in the future.
The mechanism is not belief base. Say you believe some corn seed is actually wheat but when you plant it the result is that you get corn plants and not wheat. Also if the ground is fertile and the necessary conditions are there for the seed to germinate and grow they will grown and also giving corn, regardless of belief. Same way wholesome/unwholesome state mature into pleasant/unpleasant experience, regardless of belife system.

user7309: You are expressing the stock definition of 'wrong view':

And how is right view the forerunner? One discerns wrong view as wrong
view, and right view as right view. This is one's right view. And what
is wrong view? 'There is nothing given, nothing offered, nothing
sacrificed. There is no fruit or result of good or bad actions. There
is no this world, no next world, no mother, no father, no
spontaneously reborn beings; no brahmans or contemplatives who, faring
rightly & practicing rightly, proclaim this world & the next after
having directly known & realized it for themselves.' This is wrong
view... MN117

More graphically, it is described as:

There are some contemplatives & brahmans who hold this doctrine, hold
this view: 'In acting or getting others to act, in mutilating or
getting others to mutilate, in torturing or getting others to torture,
in inflicting sorrow or in getting others to inflict sorrow, in
tormenting or getting others to torment, in intimidating or getting
others to intimidate, in taking life, taking what is not given,
breaking into houses, plundering wealth, committing burglary,
ambushing highways, committing adultery, speaking falsehood — one does
no evil. If with a razor-edged disk one were to turn all the living
beings on this earth to a single heap of flesh, a single pile of
flesh, there would be no evil from that cause, no coming of evil. Even
if one were to go along the right bank of the Ganges, killing and
getting others to kill, mutilating and getting others to mutilate,
torturing and getting others to torture, there would be no evil from
that cause, no coming of evil. Even if one were to go along the left
bank of the Ganges, giving and getting others to give, making
sacrifices and getting others to make sacrifices, there would be no
merit from that cause, no coming of merit. Through generosity,
self-control, restraint, and truthful speech there is no merit from
that cause, no coming of merit. MN60

You may choose not to believe in cosmic Karma, as in Hinduism, but kamma in Buddhism is only accrued due to intentional actions. Denying intention is denying agency, in one way or another. AN 3.61 deals with that issue, and with respect to God and kamma's place if God is to be believed in.
The Buddha did say:

Monks, these two are fools. Which two? The one who doesn't see his
transgression as a transgression, and the one who doesn't rightfully
pardon another who has confessed his transgression. These two are
fools.
These two are wise people. Which two? The one who sees his
transgression as a transgression, and the one who rightfully pardons
another who has confessed his transgression. These two are wise
people. AN 2.21

So confession is understood as wise, and acceptance of such is also, but this confession is to a human being.

-1: <p>If somebody does sin or bad karma, harms other living beings, but that person doesn't believe in karma and believes that karma is just an illusion. then how does his bad actions will harm him? For example, if I kill a mouse but I totally believe that nothing will happen, karma or religion is just people's belief, then will I ever be punished for that karma and such believe? Because there is also one saying that everything is just our belief? </p>

<p>And also if I later ask for forgiveness to god for my bad karmas then will my bad karmas be forgiven? </p>
 111: <p>This is a variation of <a href="https://www.wisdomlib.org/definition/akiriya-ditthi" rel="nofollow noreferrer">Akiriya-ditthi</a> which is basically having the view that there's no merit or demerit to your actions. This is one of the views with a <a href="https://www.wisdomlib.org/definition/niyata-micch%C4%81ditthi" rel="nofollow noreferrer">fixed destination</a>. Whether you harm someone or not, if you die with this view, you will have no other destination but hell.</p>

<p>Asking forgiveness from a 'God' will only compound one's ignorance as there is no God.</p>

<p><strong>Reply to OP's comments:</strong></p>

<p>It has a fixed destination as in if you die with that view in the mind, you end up in hell. But if a good Karma comes to the mind at the time of the death, you will go to a good place.  The three roots of evil are not always present. Ignorance is present in unenlightened beings when they do bad or good karma. But the term 'ignorance' is an umbrella term. The Pali word Avijja simply points to the lack of the understanding of the four noble truths. It does not necessarily mean having a wrong view like the one you talk about in the question. On the other hand, Micca Ditthi or having a false view is at a whole new level. </p>

<p>Ex: Not knowing the cure for diabetes is one thing, but thinking that smoking is the cure for diabetes goes way beyond simply not knowing the cure. Not only it does not cure diabetes, it will make the situation worse. In the same way, simple ignorance just extends your Samsara, but wrong views put you in hells.</p>
 -1: <p>"Wrong view" is one part of <a href="https://en.wikipedia.org/wiki/Kammapatha" rel="nofollow noreferrer">Kammapatha</a>, and one of the bad (unwholesome) mental aspects of courses of action, kamma. There are many types of "wrong view", and it seems that this particular one is unwholesome, whereas belief in a self is not</p>

<blockquote>
  <p>There are many kinds of <a href="https://www.wisdomlib.org/buddhism/book/cetasikas/d/doc2867.html" rel="nofollow noreferrer">wrong views</a> and they are of different degrees.
  Three kinds of wrong view are unwholesome courses of action, akusala
  kamma patha, through the mind, and these are capable of causing an
  unhappy rebirth.</p>
</blockquote>

<p>I think one can overplay the bad karma, rather than lack of liberation, associated with it, however, especially as people with "wrong view" <a href="https://www.accesstoinsight.org/tipitaka/mn/mn.136.nymo.html" rel="nofollow noreferrer">can</a> end up going to a higher rebirth in their next life.</p>

<hr>

<p>Right view, by contrast, is both good wholesome (good karma) and part of the Buddhist path to nirvana.</p>
 295: <p>When you follow through with an actions the motivation can be either wholesome or unwholesome . If it is wholesome then the <a href="https://suttacentral.net/define/m%C5%ABla" rel="noreferrer">roots</a> are greedlessness, hatelessness, undeludedness (alobha, adosa, amoha) and if they are unwholesome the roots are greed, hate, delusion (lobha, dosa, moha). These also are known as the <a href="https://suttacentral.net/define/hetu" rel="noreferrer">cause</a> as unwholesome volition results in unwholesome actions, if followed through, and vise versa. The wholesome and unwholesome states are like seeds. They grow and bear fruit. So when you have generate and wholesome/unwholesome state of mind this matures into pleasant/unpleasant experience in the future.</p>

<p>The mechanism is not belief base. Say you believe some corn seed is actually wheat but when you plant it the result is that you get corn plants and not wheat. Also if the ground is fertile and the necessary conditions are there for the seed to germinate and grow they will grown and also giving corn, regardless of belief. Same way wholesome/unwholesome state mature into pleasant/unpleasant experience, regardless of belife system.</p>
 7309: <p>You are expressing the stock definition of 'wrong view':</p>
<blockquote>
<p>And how is right view the forerunner? One discerns wrong view as wrong
view, and right view as right view. This is one's right view. And what
is wrong view? 'There is nothing given, nothing offered, nothing
sacrificed. There is no fruit or result of good or bad actions. There
is no this world, no next world, no mother, no father, no
spontaneously reborn beings; no brahmans or contemplatives who, faring
rightly &amp; practicing rightly, proclaim this world &amp; the next after
having directly known &amp; realized it for themselves.' This is wrong
view... <a href="http://www.accesstoinsight.org/tipitaka/mn/mn.117.than.html#s1" rel="noreferrer">MN117</a></p>
</blockquote>
<p>More graphically, it is described as:</p>
<blockquote>
<p>There are some contemplatives &amp; brahmans who hold this doctrine, hold
this view: 'In acting or getting others to act, in mutilating or
getting others to mutilate, in torturing or getting others to torture,
in inflicting sorrow or in getting others to inflict sorrow, in
tormenting or getting others to torment, in intimidating or getting
others to intimidate, in taking life, taking what is not given,
breaking into houses, plundering wealth, committing burglary,
ambushing highways, committing adultery, speaking falsehood — one does
no evil. If with a razor-edged disk one were to turn all the living
beings on this earth to a single heap of flesh, a single pile of
flesh, there would be no evil from that cause, no coming of evil. Even
if one were to go along the right bank of the Ganges, killing and
getting others to kill, mutilating and getting others to mutilate,
torturing and getting others to torture, there would be no evil from
that cause, no coming of evil. Even if one were to go along the left
bank of the Ganges, giving and getting others to give, making
sacrifices and getting others to make sacrifices, there would be no
merit from that cause, no coming of merit. Through generosity,
self-control, restraint, and truthful speech there is no merit from
that cause, no coming of merit. <a href="http://www.accesstoinsight.org/tipitaka/mn/mn.060.than.html" rel="noreferrer">MN60</a></p>
</blockquote>
<p>You may choose not to believe in cosmic Karma, as in Hinduism, but kamma in Buddhism is only accrued due to intentional actions. Denying intention is denying agency, in one way or another. <a href="https://suttacentral.net/en/an3.61" rel="noreferrer">AN 3.61</a> deals with that issue, and with respect to God and kamma's place if God is to be believed in.</p>
<p>The Buddha did say:</p>
<blockquote>
<p>Monks, these two are fools. Which two? The one who doesn't see his
transgression as a transgression, and the one who doesn't rightfully
pardon another who has confessed his transgression. These two are
fools.</p>
<p>These two are wise people. Which two? The one who sees his
transgression as a transgression, and the one who rightfully pardons
another who has confessed his transgression. These two are wise
people. AN 2.21</p>
</blockquote>
<p>So confession is understood as wise, and acceptance of such is also, but this confession is to a human being.</p>
