Doing great work gives you more employment options!
I've been on contracts and working with indirect clients before and have been given employment opportunities by said contractors/clients. I know others have experienced this too. When you do great work and are great employee, you will naturally attract offers. That's how business works and that is completely normal.
There is no harm in asking, but you want to make sure that you handle this carefully:
Get a feel for the client company. When you said:
and they all seem to like me
This is a good sign! Continue to work hard and gain their trust and partnership. The more you work well with a company, the more people want to hire you. Try to understand if an offer is something that is truly possible
Make sure you have no contractual obligation to your current company or in any legal documents you have signed. Sometimes when you work for a big B2B (Business to Business) company, they may have specific legal language or non-competes that would make working for a client be in breach of contract.
Leave your current company without burning bridges. Give the required leave notice and leave on good terms.
Do be prepared if this back-fires. Applying to the client would normally force you to keep an updated resume, but keep one just in case Company A is displeased. This doesn't seem like a likely occurrence, but if Company A gets wind of dealings with the client, they may see your "lack of loyalty" as a red flag.(However, if you work for a company that works like this, it may be a good thing...)
Bettering yourself with a better job and higher pay is something you should always be looking for! This can be a great thing if/when you make a jump to the client company because you can be a SME (subject matter expert) for the B2B relationship and future projects. This is an ethical, and honestly, quite normal occurrence in the business world.