H4 working remotely for a foreign employer, while present in the US, is a debatable topic as there is no clear guidance in the USCIS rule book for this scenario. However the law says H4 can’t get engaged in active employment and generate salary income while being present in the US unless they have H4 EAD. H4 may generate passive income, for e.g. dividend from stocks, interest income, rental income etc.
Another thing to keep in mind is US income tax compliance. If your salary is being deposited in the US account, that is a big red flag! Even if it is being deposited in your foreign/canadian bank account, if you are living in the US you will be treated as resident for tax purpose and your global income is taxable. This means you will need to report your Canadian job income and file a tax return. This in itself may create issues with future immigration process if you plan to apply for green card.
That said, lot of H4s do remote jobs and think that they are ok It is a risk that people take consciously and so I believe they are okay to face any consequences arising out of any non-compliance with the US immigration laws.