Of course they can. In most first world jurisdictions, anyone is free to bring a lawsuit against anyone else over anything, and then it's up to the court to decide on the merits of the case. If the court finds that the case was without merit, they might be able to compensate the successful party in some way depending on your particular legal system, but that would probably happen later.
What's more, if you created a system for someone, that system requires maintenance, your original contract did not specify who was responsible for that maintenance, and your clients sue claiming that they already paid for you to do that work and you're refusing to do it, you could well find yourself on the wrong end of a judgement.
In short, you seem to have quite a few misunderstandings about the basics of how contract law works, unless your local jurisdiction is a lot different to most. This is exactly why you should have everything clearly specified in a written contract, and it's also why paying an "expensive" lawyer to give you proper advice in your particular situation is almost certainly a good investment. Probably you should expect to spend significant time with a real lawyer for your first contract, so you have some idea of the general legal areas you need to consider, and then depending on how things go you might find just a quick review by someone who knows what they're doing is sufficient for a lot of later work.